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

body {
    background-image: url('intro.jpg');
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* 🔹 Overlay de carga: cubre TODA la pantalla y desvanece el fondo */
.overlay-carga {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.55);   /* desvanecido */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(2px);       /* opcional: desenfoque suave */
    backdrop-filter: blur(2px);
}

.overlay-carga .spinner {
    width: 70px;
    height: 70px;
    border: 6px solid rgba(230, 229, 226, 0.3);
    border-top-color: #af8416;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.container {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 1rem;
    min-height: 100vh;
    cursor: pointer;
}

/* Botón "Ingresar" inicial: invisible pero funcional */
#btnIngresarInicial {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

.btn-ingresar {
    position: relative;
    top: 3.8cm;
    background: linear-gradient(135deg, #af8416 0%, #af8416 20%, #af8416 45%, #af8416 55%, #af8416 80%, #af8416 100%);
    color: #e6e5e2;
    border: none;
    width: 100%;
    min-width: 320px;
    padding-top: 22px;
    padding-bottom: 33px;
    padding-left: 0;
    padding-right: 0;
    font-size: 1.6rem;
    font-weight: normal;
    letter-spacing: 2px;
    border-radius: 60px;
    cursor: pointer;
    transition: transform 0.15s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 8px rgba(122, 92, 16, 0.6);
    font-family: 'Georgia', 'Times New Roman', Times, serif;
    text-transform: none;
    text-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    -webkit-tap-highlight-color: transparent;
}

.btn-ingresar:hover {
    background: linear-gradient(135deg, #af8416 0%, #af8416 20%, #af8416 45%, #af8416 55%, #af8416 80%, #af8416 100%);
    color: #e6e5e2;
}

.btn-ingresar:active {
    background: linear-gradient(135deg, #af8416 0%, #af8416 20%, #af8416 45%, #af8416 55%, #af8416 80%, #af8416 100%);
    color: #e6e5e2;
    transform: scale(0.99);
}

.btn-ingresar:disabled {
    cursor: not-allowed;
    background: linear-gradient(135deg, #af8416 0%, #af8416 20%, #af8416 45%, #af8416 55%, #af8416 80%, #af8416 100%);
    color: #e6e5e2;
    transform: none;
}

.form-card {
    background: #ffffff;
    border-radius: 30px;
    padding: 2rem 1.8rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.hidden {
    display: none !important;
}

.form-card:not(.hidden) {
    display: block;
}

.form-subtitle {
    color: #3d3f3d;
    font-size: 0.9rem;
    margin-bottom: 1.8rem;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

.input-field {
    margin-bottom: 1.2rem;
    text-align: left;
}

.input-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #3d3f3d;
    margin-bottom: 0.4rem;
    margin-left: 0.5rem;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

.input-group {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 50px;
    border: 1px solid #c8e6c9;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: #2d6430;
    background: #ffffff;
    box-shadow: 0 0 8px rgba(46, 125, 50, 0.3);
}

.input-icon {
    padding: 0 15px;
    color: #2d6430;
    font-size: 1.2rem;
}

.form-input {
    background: transparent;
    border: none;
    padding: 14px 10px 14px 0;
    color: #333333;
    font-size: 1rem;
    width: 100%;
    outline: none;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

.form-input::placeholder {
    color: #aaaaaa;
}

.input-help {
    font-size: 0.7rem;
    color: #3d3f3d;
    margin-top: 0.3rem;
    margin-left: 0.5rem;
    font-family: 'Segoe UI', Roboto, sans-serif;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-enviar {
    top: 0 !important;
    margin-top: 0.8rem;
    width: 100% !important;
    font-family: 'Georgia', 'Times New Roman', Times, serif;
    background: linear-gradient(135deg, #af8416 0%, #af8416 20%, #af8416 45%, #af8416 55%, #af8416 80%, #af8416 100%);
}

.btn-enviar:hover {
    background: linear-gradient(135deg, #af8416 0%, #af8416 20%, #af8416 45%, #af8416 55%, #af8416 80%, #af8416 100%);
}

.form-logo {
    width: 80%;
    max-width: 250px;
    margin-bottom: 0.8rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    left: -5mm;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(230, 229, 226, 0.3);
    border-top-color: #e6e5e2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.scan-frame {
    position: relative;
    width: 100%;
    max-width: 380px;
    height: 240px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    background-color: #000;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

#videoCamara {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid #af8416;
}

.corner.top-left { top: 15px; left: 15px; border-right: none; border-bottom: none; border-top-left-radius: 8px; }
.corner.top-right { top: 15px; right: 15px; border-left: none; border-bottom: none; border-top-right-radius: 8px; }
.corner.bottom-left { bottom: 15px; left: 15px; border-right: none; border-top: none; border-bottom-left-radius: 8px; }
.corner.bottom-right { bottom: 15px; right: 15px; border-left: none; border-top: none; border-bottom-right-radius: 8px; }

.scan-line {
    position: absolute;
    top: 0;
    left: 5%;
    width: 90%;
    height: 2px;
    background-color: #af8416;
    box-shadow: 0 0 10px #af8416;
    animation: scanAnimation 2.5s infinite linear;
}

@keyframes scanAnimation {
    0% { top: 10%; }
    50% { top: 90%; }
    100% { top: 10%; }
}

.konfio-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.konfio-modal-overlay.active {
    display: flex;
}

.konfio-modal {
    position: relative;
    background-color: #ffffff;
    border-radius: 24px;
    padding: 2.5rem 2rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: konfioModalIn 0.25s ease-out;
}

@keyframes konfioModalIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.konfio-modal-title {
    font-family: 'Georgia', serif;
    font-size: 1.8rem;
    font-weight: bold;
    color: #1b5e20;
    margin-bottom: 0.5rem;
}

.konfio-modal-text {
    font-family: 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    color: #3d3f3d;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.konfio-modal-action {
    width: 100%;
    padding: 15px 0;
    font-family: 'Georgia', 'Times New Roman', Times, serif;
    font-size: 1.2rem;
    font-weight: bold;
    color: #e6e5e2;
    background: linear-gradient(135deg, #af8416 0%, #af8416 20%, #af8416 45%, #af8416 55%, #af8416 80%, #af8416 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(175, 132, 22, 0.4);
}

.konfio-modal-action:hover {
    background: linear-gradient(135deg, #916d13 0%, #916d13 20%, #916d13 45%, #916d13 55%, #916d13 80%, #916d13 100%);
    transform: scale(1.02);
}

@media (max-width: 850px) {
    .btn-ingresar {
        font-size: 1.5rem;
        top: 3.3cm;
        padding-top: 20px;
        padding-bottom: 31px;
    }
}

@media (max-width: 700px) {
    .btn-ingresar {
        font-size: 1.4rem;
        top: 3.0cm;
        padding-top: 19px;
        padding-bottom: 30px;
    }
}

@media (max-width: 580px) {
    .btn-ingresar {
        font-size: 1.3rem;
        top: 2.8cm;
        padding-top: 18px;
        padding-bottom: 28px;
    }
}

@media (max-width: 480px) {
    .btn-ingresar {
        font-size: 1.2rem;
        top: 2.5cm;
        padding-top: 16px;
        padding-bottom: 25px;
    }
    .form-card {
        padding: 1.5rem;
    }
}

@media (max-width: 380px) {
    .btn-ingresar {
        font-size: 1.1rem;
        top: 2.2cm;
        padding-top: 15px;
        padding-bottom: 23px;
    }
}
