:root {
    --primary-green: #008f68;
    --dark-green: #05513c;
    --light-green: #e6f4f0;
    --bg-light: #f8f9fa;
    --text-dark: #212529;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --input-bg: #f1f3f5;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: #e9ecef;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background-color: var(--dark-green);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 40px;
    height: 60px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-logo {
    background-color: var(--white);
    color: var(--dark-green);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    font-family: var(--font-heading);
}

.nav-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1em;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn {
    padding: 8px 16px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.9em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.lang-selector {
    font-size: 0.9em;
    cursor: pointer;
}

/* Contenedor Principal */
.main-container {
    max-width: 1000px;
    margin: 40px auto;
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.medical-form {
    padding: 40px;
}

/* Encabezado del Formulario */
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-container img {
    max-height: 60px;
    max-width: 200px;
    object-fit: contain;
}

.header-title h1 {
    font-family: var(--font-heading);
    color: var(--dark-green);
    font-size: 1.8em;
    margin-bottom: 5px;
}

.header-title .subtitle {
    color: var(--primary-green);
    font-size: 0.9em;
    font-weight: 500;
}

.header-right {
    text-align: right;
}

.header-right h2 {
    font-family: var(--font-heading);
    font-size: 1.1em;
    color: var(--dark-green);
}

.header-right .doctor-name {
    color: var(--text-light);
    font-size: 0.9em;
}

.header-right .specialty {
    color: var(--text-light);
    font-size: 0.8em;
}

/* Títulos de Sección */
.section-title {
    color: var(--primary-green);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1em;
    margin: 30px 0 15px 0;
    letter-spacing: 0.5px;
}

/* Grid del Formulario */
.form-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    margin-bottom: 20px;
}

label {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-dark);
}

.required {
    color: #dc3545;
}

.optional {
    color: var(--text-light);
    font-weight: normal;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea {
    background-color: var(--input-bg);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 12px;
    font-family: var(--font-main);
    font-size: 0.95em;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus {
    outline: none;
    background-color: var(--white);
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(0, 143, 104, 0.1);
}

/* Radio Buttons Custom */
.radio-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.radio-group.horizontal {
    height: 45px; /* Alinear con inputs */
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-label span {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: inline-block;
    position: relative;
    transition: all 0.2s ease;
}

.radio-label input[type="radio"]:checked + span {
    border-color: var(--primary-green);
}

.radio-label input[type="radio"]:checked + span::after {
    content: '';
    width: 10px;
    height: 10px;
    background-color: var(--primary-green);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Lista de Preguntas */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.question-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: var(--bg-light);
    border-radius: var(--radius);
}

.question-text {
    font-size: 0.9em;
    font-weight: 500;
    flex: 1;
    padding-right: 20px;
}

/* Sección de Alerta / Fondo Verde */
.alert-section {
    background-color: var(--light-green);
    color: var(--dark-green);
    padding: 12px 15px;
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 20px 0;
}

.sub-alert {
    font-size: 0.8em;
    font-weight: normal;
    color: var(--primary-green);
}

.questions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.questions-grid .question-item {
    background-color: var(--bg-light);
}

/* Bottom Grid (Observaciones y Firma) */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

textarea {
    resize: none;
}

.signature-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.signature-pad-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--bg-light);
    position: relative;
    height: 200px;
}

#signaturePad {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.signature-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    pointer-events: none;
    font-size: 0.9em;
}

.signature-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-clear {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 0.85em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.signature-note {
    font-size: 0.75em;
    color: var(--text-light);
    text-align: center;
    margin-top: auto;
}

/* Acciones Finales */
.form-actions {
    display: flex;
    justify-content: center;
    border-top: 2px solid var(--border-color);
    padding-top: 30px;
}

.btn-primary {
    background-color: var(--primary-green);
    color: var(--white);
    padding: 12px 40px;
    font-size: 1.1em;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 143, 104, 0.3);
}

.btn-primary:hover {
    background-color: var(--dark-green);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 143, 104, 0.4);
}

/* Responsivo */
@media (max-width: 768px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }
    .questions-grid {
        grid-template-columns: 1fr;
    }
    .bottom-grid {
        grid-template-columns: 1fr;
    }
    .form-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    .header-right {
        text-align: center;
    }
    .navbar {
        padding: 10px 20px;
    }
    .nav-right {
        gap: 10px;
    }
    .nav-title {
        display: none;
    }
}

/* Selector de Idioma */
.language-selector-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

.language-selector-container select {
    padding: 8px 15px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-selector-container select:focus {
    outline: none;
    border-color: var(--primary-green);
    background-color: var(--white);
}

/* Botón flotante de WhatsApp */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

.whatsapp-float img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}
