/* ============================================================
   ESKONDIDINHO CHECK-IN — Layout Eskondidinho
   Dark theme + Neon Green — Design System v1.0
   ============================================================ */

:root {
    /* Layout Eskondidinho — Cores */
    --bg-primary: #0d1117;
    --bg-card: #111820;
    --bg-inner: #0a0f14;
    --bg-header: rgba(13, 17, 23, 0.95);
    --text-primary: #ffffff;
    --text-secondary: #b0b8c0;
    --text-muted: #606a70;
    --accent: #00ff44;
    --accent-dark: #00cc36;
    --accent-glow: rgba(0, 255, 68, 0.25);
    --green: #00ff44;
    --green-bg: #0a1a10;
    --green-glow: rgba(0, 255, 68, 0.25);
    --red: #ff1744;
    --red-bg: #1a0a0a;
    --red-glow: rgba(255, 23, 68, 0.2);
    --yellow: #ffd600;
    --yellow-bg: #1a1a0a;
    --yellow-glow: rgba(255, 214, 0, 0.2);
    --border: rgba(0, 255, 68, 0.12);
    --border-strong: rgba(0, 255, 68, 0.25);
    --radius: 16px;
    --radius-sm: 12px;
    --font: 'Inter', -apple-system, sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glow: 0 0 20px rgba(0, 255, 68, 0.08), inset 0 0 20px rgba(0, 255, 68, 0.03);
    --glow-strong: 0 0 30px rgba(0, 255, 68, 0.15);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    user-select: none;
    -webkit-user-select: none;
}

.hidden {
    display: none !important;
}

/* ─── LOADING SCREEN ──────────────────────────────────────── */

.loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    padding: 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    box-shadow: var(--glow);
    max-width: 420px;
    width: 90%;
}

.loading-logo {
    margin-bottom: 16px;
    animation: float 2s ease-in-out infinite;
}

/* ─── NEON K LOGOS — logoesk premium ──────────────────────── */

.k-logo-lg,
.k-logo-md,
.k-logo-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-family: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
    color: #00ff66;
    background: linear-gradient(160deg, #0c0c11 0%, #050507 100%);
    border: 1.5px solid #00ff66;
    text-shadow: 0 0 8px rgba(0,255,102,.85), 0 0 18px rgba(0,255,102,.45);
    box-shadow: 0 0 18px rgba(0,255,102,.35),
                inset 0 0 12px rgba(0,255,102,.12),
                0 6px 18px -6px rgba(0,0,0,.7);
    position: relative;
    overflow: hidden;
    animation: kBreathe 3.6s ease-in-out infinite, kGlyphPulse 3.6s ease-in-out infinite;
    transition: transform .3s cubic-bezier(.2,.9,.3,1.2), border-color .3s;
}
.k-logo-lg::before,
.k-logo-md::before,
.k-logo-sm::before {
    content: '';
    position: absolute;
    top: -50%; left: -60%;
    width: 40%; height: 200%;
    background: linear-gradient(100deg,
        transparent 0%,
        rgba(255,255,255,.09) 45%,
        rgba(255,255,255,.20) 50%,
        rgba(255,255,255,.09) 55%,
        transparent 100%);
    transform: rotate(12deg);
    animation: kSheen 6s ease-in-out infinite;
    pointer-events: none;
}

.k-logo-lg {
    width: 80px;
    height: 80px;
    font-size: 42px;
    border-radius: 18px;
    border-width: 2px;
    animation: kBreatheLg 3.6s ease-in-out infinite, kGlyphPulseLg 3.6s ease-in-out infinite, kFloat 5s ease-in-out infinite;
}

.k-logo-md {
    width: 64px;
    height: 64px;
    font-size: 34px;
    border-radius: 14px;
    border-width: 2px;
    animation: kBreatheLg 3.6s ease-in-out infinite, kGlyphPulseLg 3.6s ease-in-out infinite, kFloat 5s ease-in-out infinite;
}

.k-logo-sm {
    width: 38px;
    height: 38px;
    font-size: 20px;
    border-radius: 8px;
}

/* Inline neon K for titles */
.neon-k {
    color: var(--accent);
    text-shadow: 0 0 12px var(--accent-glow);
}

.neon-k-sm {
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
}

.loading-content h1 {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 5px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.loading-content p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.loading-bar {
    width: 200px;
    height: 3px;
    background: var(--bg-inner);
    border-radius: 3px;
    margin: 0 auto;
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    width: 30%;
    background: var(--accent);
    border-radius: 3px;
    box-shadow: 0 0 10px var(--accent-glow);
    animation: loading 1.5s ease-in-out infinite;
}

/* ─── APP LAYOUT ──────────────────────────────────────────── */

.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── HEADER ──────────────────────────────────────────────── */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    z-index: 10;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--text-primary);
}

.header-subtitle {
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--accent-glow);
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--bg-inner);
    border-radius: 20px;
    border: 1px solid var(--border);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--yellow);
    transition: background var(--transition);
}

.status-dot.connected {
    background: var(--green);
    box-shadow: 0 0 8px var(--green-glow);
}

.status-dot.disconnected {
    background: var(--red);
}

.status-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    gap: 12px;
}

.stat-box {
    text-align: center;
    padding: 8px 16px;
    background: var(--bg-inner);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    min-width: 80px;
}

.stat-value {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-success .stat-value {
    color: var(--green);
    text-shadow: 0 0 10px var(--green-glow);
}

.stat-pending .stat-value {
    color: var(--yellow);
}

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ─── MAIN AREA ───────────────────────────────────────────── */

.main-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* Background glow */
.main-area::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 68, 0.06) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: all 0.5s ease;
}

.main-area.state-approved::before {
    background: radial-gradient(circle, rgba(0, 255, 68, 0.15) 0%, transparent 60%);
    width: 900px;
    height: 900px;
}

.main-area.state-denied::before {
    background: radial-gradient(circle, rgba(255, 23, 68, 0.12) 0%, transparent 60%);
    width: 900px;
    height: 900px;
}

.main-area.state-used::before {
    background: radial-gradient(circle, rgba(255, 214, 0, 0.12) 0%, transparent 60%);
    width: 900px;
    height: 900px;
}

/* ─── RESULT CARDS ────────────────────────────────────────── */

.result-card {
    text-align: center;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.3s ease;
    padding: 40px 60px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--glow);
    min-width: 400px;
}

.result-card.idle {
    background: transparent;
    border: none;
    box-shadow: none;
}

.result-card.approved {
    border-color: var(--green);
    box-shadow: 0 0 40px rgba(0, 255, 68, 0.15), inset 0 0 30px rgba(0, 255, 68, 0.05);
}

.result-card.already-used {
    border-color: var(--yellow);
    box-shadow: 0 0 40px rgba(255, 214, 0, 0.15);
}

.result-card.denied {
    border-color: var(--red);
    box-shadow: 0 0 40px rgba(255, 23, 68, 0.15);
}

.result-icon {
    font-size: 96px;
    line-height: 1;
    margin-bottom: 16px;
    display: inline-block;
}

.result-title {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 4px;
    margin-bottom: 12px;
}

.idle .result-title {
    color: var(--text-muted);
    font-size: 36px;
}

.approved .result-title {
    color: var(--green);
    text-shadow: 0 0 30px var(--green-glow);
}

.already-used .result-title {
    color: var(--yellow);
    text-shadow: 0 0 30px var(--yellow-glow);
}

.denied .result-title {
    color: var(--red);
    text-shadow: 0 0 30px var(--red-glow);
}

.processing .result-title {
    color: var(--accent);
}

.result-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.result-detail {
    font-size: 16px;
    color: var(--text-muted);
    margin-top: 8px;
}

.result-countdown {
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

/* QR Hint */
.qr-hint {
    margin-top: 32px;
}

.qr-box {
    width: 140px;
    height: 140px;
    border: 2px solid var(--accent);
    border-radius: 12px;
    margin: 0 auto;
    position: relative;
    opacity: 0.6;
    box-shadow: 0 0 20px rgba(0, 255, 68, 0.12);
    overflow: hidden;
}

/* Scanner line — green streak that sweeps up and down */
.scanner-line {
    position: absolute;
    left: 4px;
    right: 4px;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 12px 4px rgba(0, 255, 68, 0.6), 0 0 40px 8px rgba(0, 255, 68, 0.2);
    border-radius: 2px;
    animation: scanLine 2s ease-in-out infinite;
}

/* logoesk keyframes */
@keyframes kBreathe {
    0%, 100% { box-shadow: 0 0 14px rgba(0,255,102,.28), inset 0 0 8px rgba(0,255,102,.08), 0 6px 18px -6px rgba(0,0,0,.7); }
    50%      { box-shadow: 0 0 22px rgba(0,255,102,.48), inset 0 0 14px rgba(0,255,102,.18), 0 6px 18px -6px rgba(0,0,0,.7); }
}
@keyframes kBreatheLg {
    0%, 100% { box-shadow: 0 0 20px rgba(0,255,102,.35), inset 0 0 14px rgba(0,255,102,.12), 0 6px 18px -6px rgba(0,0,0,.7); }
    50%      { box-shadow: 0 0 36px rgba(0,255,102,.58), inset 0 0 22px rgba(0,255,102,.22), 0 6px 18px -6px rgba(0,0,0,.7); }
}
@keyframes kGlyphPulse {
    0%, 100% { text-shadow: 0 0 6px rgba(0,255,102,.75), 0 0 14px rgba(0,255,102,.38); }
    50%      { text-shadow: 0 0 10px rgba(0,255,102,1), 0 0 20px rgba(0,255,102,.60); }
}
@keyframes kGlyphPulseLg {
    0%, 100% { text-shadow: 0 0 10px rgba(0,255,102,.80), 0 0 22px rgba(0,255,102,.45); }
    50%      { text-shadow: 0 0 16px rgba(0,255,102,1), 0 0 32px rgba(0,255,102,.70); }
}
@keyframes kSheen {
    0%, 65%, 100% { left: -60%; opacity: 0; }
    70%           { opacity: .85; }
    95%           { left: 120%; opacity: 0; }
}
@keyframes kFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}

@keyframes scanLine {

    0%,
    100% {
        top: 8px;
        opacity: 0.4;
    }

    50% {
        top: calc(100% - 10px);
        opacity: 1;
    }
}

.qr-box::before,
.qr-box::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 2px solid var(--accent);
    z-index: 1;
}

.qr-box::before {
    top: 8px;
    left: 8px;
    border-right: none;
    border-bottom: none;
    border-radius: 4px 0 0 0;
}

.qr-box::after {
    bottom: 8px;
    right: 8px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 4px 0;
}

/* Ticket info */
.ticket-info {
    margin-top: 8px;
}

.ticket-name {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ticket-type {
    font-size: 18px;
    color: var(--accent);
    padding: 4px 16px;
    background: var(--bg-inner);
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    text-shadow: 0 0 8px var(--accent-glow);
}

.ticket-event {
    font-size: 16px;
    color: var(--text-muted);
}

.ticket-detail {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ─── FOOTER ──────────────────────────────────────────────── */

.footer {
    padding: 12px 24px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.footer-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 8px;
    text-shadow: 0 0 8px var(--accent-glow);
}

.recent-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.recent-list::-webkit-scrollbar {
    display: none;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg-inner);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    white-space: nowrap;
    min-width: 200px;
    flex-shrink: 0;
}

.recent-icon {
    font-size: 18px;
}

.recent-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.recent-time {
    font-size: 11px;
    color: var(--text-muted);
}

.recent-empty {
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 0;
}

/* ─── SCANNER INPUT (hidden) ──────────────────────────────── */

.scanner-input {
    position: fixed;
    top: -100px;
    left: -100px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* ─── FULLSCREEN FLASH EFFECTS ────────────────────────────── */

.flash-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    animation: flash 0.6s ease-out forwards;
}

.flash-approved {
    background: rgba(0, 255, 68, 0.12);
}

.flash-denied {
    background: rgba(255, 23, 68, 0.12);
}

.flash-used {
    background: rgba(255, 214, 0, 0.12);
}

/* ─── ANIMATIONS ──────────────────────────────────────────── */

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(200%);
    }

    100% {
        transform: translateX(-100%);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes flash {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@keyframes qrPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

.bounce {
    animation: bounceIn 0.5s ease;
}

.shake {
    animation: shakeX 0.5s ease;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    70% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shakeX {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-8px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(8px);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ─── RESPONSIVE ──────────────────────────────────────────── */

@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 12px;
    }

    .header-center {
        position: static;
        transform: none;
        order: 3;
        width: 100%;
        text-align: center;
    }

    .header-right {
        gap: 6px;
    }

    .stat-box {
        padding: 4px 10px;
        min-width: 60px;
    }

    .stat-value {
        font-size: 18px;
    }

    .result-icon {
        font-size: 72px;
    }

    .result-title {
        font-size: 36px;
    }

    .ticket-name {
        font-size: 24px;
    }

    .result-card {
        min-width: auto;
        padding: 24px;
    }
}

/* ─── AUTH OVERLAY ────────────────────────────────────────── */

.auth-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.4s ease;
}

.auth-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.auth-card {
    text-align: center;
    padding: 56px 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    box-shadow: 0 0 60px rgba(0, 255, 68, 0.08), var(--glow);
    max-width: 440px;
    width: 90%;
    animation: fadeIn 0.4s ease;
}

.auth-logo-wrap {
    margin-bottom: 20px;
    animation: float 2.5s ease-in-out infinite;
}

.auth-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    filter: drop-shadow(0 0 24px rgba(0, 255, 68, 0.55));
}

.auth-title {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 6px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 12px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
    margin-bottom: 36px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-inner);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 16px;
    gap: 10px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.auth-input-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.auth-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    padding: 14px 0;
    font-size: 16px;
    color: var(--text-primary);
    font-family: var(--font);
}

.auth-input::placeholder {
    color: var(--text-muted);
    font-size: 14px;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 1px;
    box-shadow: 0 0 20px var(--accent-glow);
}

.auth-btn:hover {
    background: var(--accent-dark);
    box-shadow: 0 0 30px var(--green-glow);
    transform: translateY(-1px);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-btn-icon {
    font-size: 18px;
    transition: transform var(--transition);
}

.auth-btn:hover .auth-btn-icon {
    transform: translateX(4px);
}

.auth-error {
    font-size: 13px;
    color: var(--red);
    min-height: 18px;
    text-align: center;
}

@keyframes shake-input {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-8px);
    }

    40%,
    80% {
        transform: translateX(8px);
    }
}

.shake-input {
    animation: shake-input 0.4s ease;
    border-color: var(--red) !important;
}

/* ─── ACTION BUTTONS (header) ─────────────────────────────── */

.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: 8px;
}

.action-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-inner);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    color: var(--text-primary);
    flex-shrink: 0;
}

.action-btn:hover {
    border-color: var(--accent);
    background: rgba(0, 255, 68, 0.08);
    box-shadow: 0 0 12px var(--accent-glow);
    transform: translateY(-1px);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.tv-btn:hover {
    border-color: #4fc3f7;
    background: rgba(79, 195, 247, 0.08);
    box-shadow: 0 0 12px rgba(79, 195, 247, 0.2);
}

.export-btn:hover {
    border-color: var(--accent);
}

.sync-btn:hover {
    border-color: var(--yellow);
    background: rgba(255, 214, 0, 0.08);
}