/* =====================================================================
   REGISTRO DE FICHA E HISTORIAL
   ===================================================================== */

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    /* Elimina el scroll horizontal en toda la página */
    font-family: Arial, sans-serif;
    /* La imagen se renderiza en su estado original nítido */
    background: url('../img/background.jpg') no-repeat center center fixed;
    background-size: cover;
}

/* Capa oscura exclusiva para el formulario (Mantiene el scroll nativo) */
.fondo-oscuro-formulario {
    width: 100%;
    min-height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    /* Cortina oscura idéntica al Login */
    display: block;
    /* Evita que actúe como el flexbox del Login */
}

/* ══════════════════════════════════════════════════════════════════════
   PANTALLA 1 — LOGIN
   ══════════════════════════════════════════════════════════════════════ */

.background {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.login-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 30px;
    width: 350px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.logo img {
    width: 100px;
    margin-bottom: 20px;
}

h1 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

#loginForm {
    display: flex;
    flex-direction: column;
}

#loginForm input {
    margin-bottom: 15px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    outline: none;
    transition: border-color 0.2s ease;
}

#loginForm input:focus {
    border-color: #f7941d;
    box-shadow: 0 0 0 2px rgba(247, 148, 29, 0.2);
}

#loginForm button {
    padding: 10px;
    font-size: 16px;
    color: #fff;
    background-color: #f7941d;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

#loginForm button:hover {
    background-color: #e5830c;
}

#loginForm button:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

/* ══════════════════════════════════════════════════════════════════════
   PANTALLA 2 — CUESTIONARIO
   ══════════════════════════════════════════════════════════════════════ */

#pantallaFormulario {
    position: relative;
    box-sizing: border-box;
    /* Sin min-height:100vh forzado. El fondo oscuro ya cubre toda la pantalla;
       así el contenido toma solo la altura que necesita y no genera scroll extra. */
}

.form-topbar {
    background-color: #f7941d;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Forzamos que el título H2 siempre se mantenga centrado en el bloque */
.form-topbar h2 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    flex-grow: 1;
    text-align: center;
}

/* Logo Izquierdo (UNEVE) dentro de la barra naranja */
.logo-topbar-izq {
    height: 25px;
    /* Tamaño prudente para no distorsionar la barra */
    width: auto;
    object-fit: contain;
}

/* Logo Derecho (CONOCER) dentro de la barra naranja */
.logo-topbar-der {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.form-body {
    padding-top: 24px;
    padding-bottom: 52px;
    /* Solo lo necesario para que el footer fijo (40px) no tape el botón */
    max-width: 960px;
}

/* ── Secciones ───────────────────────────────────────────────────────── */
.seccion-formulario {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 28px;
    overflow: hidden;
}

.seccion-header {
    background: linear-gradient(135deg, #f7941d, #e5830c);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 13px 22px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.seccion-body {
    padding: 24px;
}

/* ── Campos ficha ────────────────────────────────────────────────────── */
.form-label.fw-bold {
    color: #444;
    font-size: 13.5px;
}

.form-control,
.form-select {
    border: 1.5px solid #d1d5db;
    border-radius: 7px;
    padding: 9px 13px;
    font-size: 14.5px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: #f7941d;
    box-shadow: 0 0 0 3px rgba(247, 148, 29, 0.18);
    outline: none;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

/* ══════════════════════════════════════════════════════════════════════
   SECCION 2 — GRID DE ANTECEDENTES (2 columnas)
   ══════════════════════════════════════════════════════════════════════ */

.ant-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ant-card {
    background: #fafafa;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    padding: 16px 18px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ant-card:hover {
    border-color: #f7941d;
    box-shadow: 0 2px 10px rgba(247, 148, 29, 0.1);
}

.ant-num {
    font-size: 10.5px;
    font-weight: 700;
    color: #f7941d;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.ant-texto {
    font-size: 14.5px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* ── Botones Si / No ─────────────────────────────────────────────────── */
.ant-botones {
    display: flex;
    gap: 10px;
}

.btn-inciso {
    flex: 1;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 600;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background-color: #fff;
    color: #555;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: center;
    user-select: none;
}

.btn-inciso:hover {
    border-color: #f7941d;
    background-color: #fff8f0;
    color: #c96800;
}

.btn-inciso.selected {
    background-color: #f7941d;
    border-color: #f7941d;
    color: #fff;
    box-shadow: 0 3px 10px rgba(247, 148, 29, 0.35);
}

/* ── Campo Especifica ────────────────────────────────────────────────── */
.especifica-wrap {
    margin-top: 10px;
    animation: fadeIn 0.22s ease;
}

.especifica-label {
    font-size: 12.5px;
    color: #777;
    font-style: italic;
    margin-bottom: 4px;
    display: block;
}

.especifica-textarea {
    width: 100%;
    border: 1.5px solid #d1d5db;
    border-radius: 7px;
    padding: 8px 11px;
    font-size: 14px;
    resize: vertical;
    min-height: 62px;
    transition: border-color 0.2s;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
}

.especifica-textarea:focus {
    border-color: #f7941d;
    box-shadow: 0 0 0 3px rgba(247, 148, 29, 0.15);
    outline: none;
}

.especifica-textarea.is-invalid {
    border-color: #dc3545;
}

/* ── Error mensaje ───────────────────────────────────────────────────── */
.ant-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 6px;
}

/* ── Boton enviar ────────────────────────────────────────────────────── */
.btn-enviar {
    padding: 14px 52px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    background-color: #f7941d;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.22s ease;
    min-width: 260px;
}

.btn-enviar:hover {
    background-color: #e5830c;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(247, 148, 29, 0.3);
}

.btn-enviar:active {
    transform: translateY(0);
}

.btn-enviar:disabled {
    background-color: #aaa;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.logoedomex {
    height: 100%;
}

.barra-bottom {
    background-color: #a02444;
    color: white;
    padding-left: 100px;
    padding-right: 60px;
    padding-top: 5px;
    padding-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    /* El padding ya NO expande el ancho total */
    z-index: 1000;
}

.footertexto {
    font-size: 70%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    margin-top: 10px;
}

/* ── Animaciones ─────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .login-container {
        width: 90%;
        max-width: 350px;
    }

    .ant-grid {
        grid-template-columns: 1fr;
    }

    .btn-enviar {
        width: 100%;
        padding: 13px;
    }

    .barra-bottom {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 576px) {
    .form-topbar {
        padding: 12px 15px;
        flex-direction: row;
    }

    .form-topbar h2 {
        font-size: 16px;
    }

    .logo-topbar-izq {
        height: 28px;
    }

    .logo-topbar-der {
        height: 24px;
    }
}