/* ==========================================================================
   SistemGym - Kiosk Access Theme (Clean White Card on Modern Dark Ambient)
   ========================================================================== */

:root {
    --primary-amber: #f59e0b;
    --primary-amber-light: #fbbf24;
    --primary-amber-dark: #d97706;
    --primary-glow: rgba(245, 158, 11, 0.28);

    --emerald: #10b981;
    --emerald-light: #34d399;
    --emerald-bg: #ecfdf5;
    --emerald-border: #a7f3d0;
    --emerald-text: #065f46;

    --rose: #ef4444;
    --rose-light: #f87171;
    --rose-bg: #fef2f2;
    --rose-border: #fecaca;
    --rose-text: #991b1b;

    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;
}

* {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
    margin: 0;
}

body {
    font-family: Inter, Segoe UI, system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at 15% 15%, rgba(245, 158, 11, 0.12) 0%, transparent 45%),
                radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.08) 0%, transparent 45%),
                radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 60%, #020617 100%);
    background-color: #0b1120;
    color: var(--slate-100);
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

/* Patrón sutil de fondo tecnológico */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.kiosk-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Encabezado */
.kiosk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px clamp(20px, 4vw, 56px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.kiosk-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.kiosk-brand img {
    width: 52px;
    height: 52px;
    border: 2px solid var(--primary-amber);
    border-radius: 50%;
    object-fit: cover;
    background: #ffffff;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.28);
    flex-shrink: 0;
}

.kiosk-brand span {
    display: block;
    color: var(--primary-amber-light);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.kiosk-brand strong {
    display: block;
    max-width: 55vw;
    overflow: hidden;
    color: #ffffff;
    font-size: clamp(1.05rem, 2.5vw, 1.35rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kiosk-top-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Botón de control de voz */
.btn-voice-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--slate-100);
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-voice-toggle:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--primary-amber-light);
    color: var(--primary-amber-light);
    transform: translateY(-1px);
}

.btn-voice-toggle.is-muted {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.35);
    color: var(--rose-light);
}

/* Reloj Kiosco */
.kiosk-clock {
    text-align: right;
}

.kiosk-clock strong {
    font-size: 1.45rem;
    color: #ffffff;
    display: block;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.kiosk-clock span {
    display: block;
    color: var(--slate-400);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: capitalize;
    margin-top: 2px;
}

/* Área Principal */
.kiosk-main,
.kiosk-card {
    flex: 1;
    display: grid;
    place-items: center;
    justify-content: center;
    align-content: center;
    padding: clamp(20px, 4vw, 48px);
    width: 100%;
    margin: 0 auto;
}

/* ==========================================================================
   Tarjetas Principales (FONDO BLANCO LIMPIO COMO EN EL LOGIN)
   ========================================================================== */
.check-panel,
.result-panel {
    width: min(560px, 100%);
    padding: clamp(28px, 5vw, 42px);
    border-radius: 24px;
    background: #ffffff;
    color: var(--slate-900);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 25px 65px -15px rgba(0, 0, 0, 0.45),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1;
    animation: kioskFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes kioskFadeIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.kiosk-eyebrow,
.result-type {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 5px 14px;
    border-radius: 9999px;
    text-transform: uppercase;
    margin: 0 0 12px;
}

.check-panel h1 {
    margin: 0 0 6px;
    font-size: clamp(1.8rem, 5vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--slate-900);
    line-height: 1.15;
}

.kiosk-lead {
    margin: 0 0 22px;
    color: var(--slate-500);
    font-size: 0.94rem;
    line-height: 1.45;
}

/* ==========================================================================
   Zona Biométrica ZKTeco
   ========================================================================== */
.biometric-zone {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border: 1.5px solid var(--slate-200);
    border-radius: 18px;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}

.biometric-zone.is-reading {
    border-color: var(--primary-amber);
    background: #fffbeb;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.biometric-zone.is-reading .bio-icon {
    border-color: var(--primary-amber);
    color: var(--primary-amber-dark);
}

.biometric-zone.is-reading .bio-pulse-ring {
    background: var(--primary-amber);
    opacity: 0.35;
}

.biometric-zone.is-error {
    border-color: var(--rose) !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18) !important;
}

.biometric-zone.is-error .bio-icon {
    color: var(--rose) !important;
    border-color: var(--rose) !important;
}

.biometric-zone.is-error .bio-pulse-ring {
    background: var(--rose) !important;
    opacity: 0.4 !important;
}

.bio-icon-wrapper {
    position: relative;
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    flex-shrink: 0;
}

.bio-pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--emerald);
    opacity: 0.22;
    animation: bioPulse 2.4s infinite ease-out;
}

@keyframes bioPulse {
    0% { transform: scale(0.85); opacity: 0.5; }
    50% { transform: scale(1.22); opacity: 0.1; }
    100% { transform: scale(0.85); opacity: 0.5; }
}

.bio-icon {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #ffffff;
    color: #059669;
    border: 2px solid #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transition: all 0.25s ease;
}

.bio-info {
    flex: 1;
    min-width: 0;
}

.bio-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 9999px;
    background: var(--emerald-bg);
    border: 1px solid var(--emerald-border);
    margin-bottom: 5px;
    transition: all 0.25s ease;
}

.bio-status-pill.is-error {
    background: var(--rose-bg) !important;
    border-color: var(--rose-border) !important;
}

.bio-status-pill.is-error .bio-status-dot {
    background: var(--rose) !important;
    box-shadow: 0 0 10px var(--rose) !important;
    animation: blinkDotError 0.7s infinite ease-in-out !important;
}

@keyframes blinkDotError {
    0%, 100% { opacity: 1; transform: scale(1.15); }
    50% { opacity: 0.35; transform: scale(0.85); }
}

.bio-status-pill.is-error strong {
    color: var(--rose-text) !important;
}

.bio-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--emerald);
    box-shadow: 0 0 8px var(--emerald);
    animation: blinkDot 1.8s infinite ease-in-out;
}

@keyframes blinkDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.bio-status-pill strong {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--emerald-text);
    letter-spacing: 0.03em;
}

.bio-hint {
    display: block;
    color: var(--slate-500);
    font-size: 0.82rem;
    line-height: 1.35;
}

/* Divisor */
.kiosk-divider {
    display: flex;
    align-items: center;
    margin: 22px 0 18px;
    text-align: center;
}

.kiosk-divider::before,
.kiosk-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1.5px solid var(--slate-200);
}

.kiosk-divider span {
    padding: 0 14px;
    color: var(--slate-400);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Formulario PIN / QR */
.kiosk-label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--slate-700);
    letter-spacing: 0.01em;
}

.input-scanner-wrapper {
    display: flex;
    gap: 10px;
}

.input-scanner-wrapper input {
    flex: 1;
    min-width: 0;
    height: 58px;
    padding: 0 18px;
    border: 1.5px solid var(--slate-300);
    border-radius: 14px;
    background: #f8fafc;
    color: var(--slate-900);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.input-scanner-wrapper input:focus {
    background: #ffffff;
    border-color: var(--primary-amber);
    box-shadow: 0 0 0 3.5px rgba(245, 158, 11, 0.2);
}

.input-scanner-wrapper input::placeholder {
    color: var(--slate-400);
    font-weight: 500;
    font-size: 0.98rem;
    letter-spacing: normal;
}

.btn-cam-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 16px;
    border: 1.5px solid var(--slate-300);
    border-radius: 14px;
    background: #f8fafc;
    color: var(--slate-700);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-cam-trigger:hover {
    background: #fef3c7;
    border-color: var(--primary-amber);
    color: #92400e;
    transform: translateY(-1px);
}

/* Escáner de cámara integrado */
.cam-scanner-box {
    margin-top: 16px;
    border: 1.5px solid var(--slate-200);
    border-radius: 18px;
    overflow: hidden;
    background: #020617;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.cam-scanner-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    max-height: 280px;
    overflow: hidden;
    background: #000;
}

.cam-scanner-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cam-scanner-target {
    position: absolute;
    inset: 15% 18%;
    border: 2px dashed var(--primary-amber-light);
    border-radius: 16px;
    box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.65);
    pointer-events: none;
    animation: targetGlow 2s infinite alternate;
}

@keyframes targetGlow {
    from { border-color: var(--primary-amber-light); }
    to { border-color: #ffffff; }
}

.cam-scanner-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #ffffff;
    border-top: 1px solid var(--slate-200);
}

.btn-cancel-cam {
    padding: 6px 14px;
    border: 1px solid var(--slate-300);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--slate-700);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-cam:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

/* Botones de acción principales */
.btn-submit-kiosk,
.btn-new-check {
    width: 100%;
    min-height: 52px;
    margin-top: 18px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-amber-light) 0%, var(--primary-amber) 100%);
    color: var(--slate-950);
    font-size: 1.02rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 8px 20px -4px rgba(245, 158, 11, 0.45);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-submit-kiosk:hover,
.btn-new-check:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px -4px rgba(245, 158, 11, 0.55);
}

.btn-submit-kiosk:active,
.btn-new-check:active {
    transform: translateY(0);
}

.kiosk-footer-hint {
    margin-top: 22px;
    color: var(--slate-400);
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.45;
}

/* ==========================================================================
   Panel de Resultados (FONDO BLANCO LIMPIO)
   ========================================================================== */
.result-panel {
    text-align: center;
    position: relative;
    padding-top: 48px;
}

.result-panel.allowed {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2), 0 25px 65px -15px rgba(0, 0, 0, 0.45);
}

.result-panel.denied {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2), 0 25px 65px -15px rgba(0, 0, 0, 0.45);
}

.result-symbol {
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    margin: 0 auto -33px;
    position: relative;
    top: -48px;
    margin-bottom: -38px;
    z-index: 5;
    border-radius: 50%;
    background: var(--emerald);
    color: #ffffff;
    font-size: 2.2rem;
    font-weight: 900;
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.45);
}

.denied .result-symbol {
    background: var(--rose);
    box-shadow: 0 8px 22px rgba(239, 68, 68, 0.45);
}

.result-panel > img {
    width: 170px;
    height: 170px;
    border: 4px solid var(--emerald);
    border-radius: 50%;
    object-fit: cover;
    background: var(--slate-100);
    margin: 0 auto 14px;
    display: block;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.25);
}

.denied > img {
    border-color: var(--rose);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.25);
}

.result-panel h2 {
    margin: 6px 0 10px;
    font-size: clamp(1.5rem, 5vw, 2.1rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--slate-900);
}

.result-status {
    display: inline-block;
    margin-bottom: 18px;
    padding: 6px 18px;
    border-radius: 9999px;
    background: var(--emerald-bg);
    border: 1px solid var(--emerald-border);
    color: var(--emerald-text);
    font-weight: 800;
    font-size: 0.88rem;
    letter-spacing: 0.04em;
}

.denied .result-status {
    background: var(--rose-bg);
    border-color: var(--rose-border);
    color: var(--rose-text);
}

.result-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 14px 0 18px;
}

.result-metrics div {
    padding: 12px 8px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--slate-200);
}

.result-metrics dt {
    color: var(--slate-500);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.result-metrics dd {
    margin: 4px 0 0;
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--slate-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-message {
    margin: 12px 0 16px;
    color: var(--slate-600);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Botón Siguiente Persona en Kiosco */
.btn-kiosk-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 10px 24px;
    border-radius: 9999px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    margin-top: 8px;
}

.btn-kiosk-next:hover {
    background: #ffffff;
    border-color: #94a3b8;
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.btn-kiosk-next:active {
    transform: translateY(0);
}

/* Responsividad para Tabletas y Celulares */
@media (max-width: 600px) {
    .kiosk-header {
        padding: 12px 16px;
    }

    .kiosk-brand img {
        width: 44px;
        height: 44px;
    }

    .kiosk-clock span {
        display: none;
    }

    .kiosk-main {
        align-items: start;
        padding: 16px 12px;
    }

    .check-panel,
    .result-panel {
        border-radius: 20px;
        padding: 24px 16px;
    }

    .biometric-zone {
        padding: 12px 14px;
        gap: 12px;
    }

    .bio-icon-wrapper {
        width: 52px;
        height: 52px;
    }

    .bio-icon {
        width: 46px;
        height: 46px;
    }

    .bio-icon svg {
        width: 36px;
        height: 36px;
    }

    .input-scanner-wrapper {
        flex-direction: column;
    }

    .input-scanner-wrapper input {
        height: 54px;
        font-size: 1.15rem;
    }

    .btn-cam-trigger {
        padding: 10px;
        flex-direction: row;
        gap: 8px;
    }

    .result-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .result-panel > img {
        width: 135px;
        height: 135px;
    }
}
