/* ═══════════════════════════════════════════════════════
   login.css — Sistema de login com cards, QR e PIN
   ═══════════════════════════════════════════════════════ */

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

body {
    background: #000;
    color: #ccc;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ── Painel central ─────────────────────────────────── */
.login-panel {
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.login-panel h1 {
    font-size: 28px;
    color: #fff;
    margin-bottom: 8px;
}

.login-panel .subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 32px;
}

/* ── Tela ─────────────────────────────────────────── */
.login-screen {
    display: none;
}
.login-screen.active {
    display: block;
}

/* ── Cards de usuário (Netflix style) ──────────────── */
.cards-container {
    display: flex;
    gap: 16px;
    justify-content: center;
    overflow-x: auto;
    padding: 10px 0 20px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.user-card {
    flex: 0 0 auto;
    width: 140px;
    background: #111;
    border: 2px solid #333;
    border-radius: 12px;
    padding: 20px 12px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    scroll-snap-align: center;
    touch-action: manipulation;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.user-card:hover,
.user-card:focus {
    border-color: #00ff66;
    transform: scale(1.04);
    outline: none;
}
/* TV: foco via teclado/controle */
.user-card:focus-visible {
    border-color: #00ff66;
    box-shadow: 0 0 0 3px rgba(0,255,102,0.3);
}

.user-card .avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    background: #222;
}
.user-card .avatar-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2b5cff, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    color: #fff;
}
.user-card .card-name {
    font-size: 13px;
    color: #ccc;
    text-align: center;
    word-break: break-word;
}

/* ── Formulário padrão ──────────────────────────────── */
.login-box {
    background: #111;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 28px;
    box-shadow: 0 0 20px rgba(0,255,102,0.08);
}

.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    background: #000;
    border: 1px solid #444;
    color: #fff;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.2s;
}
.login-box input:focus,
.login-box input:focus-visible {
    border-color: #00ff66;
    outline: none;
}

.btn-primary {
    width: 100%;
    padding: 13px;
    background: #00ff66;
    border: none;
    color: #000;
    font-weight: bold;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover { background: #00e55c; }
.btn-primary:focus-visible {
    outline: 3px solid #00ff66;
    outline-offset: 2px;
}
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid #444;
    color: #aaa;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 8px;
    transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
    border-color: #00ff66;
    color: #fff;
    outline: none;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: #fff;
    border: 1px solid #555;
    color: #333;
    font-weight: bold;
    border-radius: 4px;
    font-size: 15px;
    margin-top: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-google:hover { background: #f1f1f1; }
.btn-google:focus-visible {
    outline: 3px solid #4285f4;
    outline-offset: 2px;
}

.btn-microsoft {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: #0078d4;
    border: none;
    color: #fff;
    font-weight: bold;
    border-radius: 4px;
    font-size: 15px;
    margin-top: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-microsoft:hover { background: #006abc; }
.btn-microsoft:focus-visible {
    outline: 3px solid #0078d4;
    outline-offset: 2px;
}

.btn-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px;
    background: transparent;
    border: 1px solid #555;
    color: #aaa;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 8px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.btn-qr:hover,
.btn-qr:focus-visible {
    border-color: #00ff66;
    color: #00ff66;
    outline: none;
}

.separator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 4px;
    color: #555;
    font-size: 13px;
}
.separator::before,
.separator::after {
    content: '';
    flex: 1;
    border-top: 1px solid #333;
}

.link-alt {
    display: block;
    margin-top: 20px;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    background: none;
    border: none;
    width: 100%;
    text-align: center;
}
.link-alt:hover,
.link-alt:focus-visible {
    color: #aaa;
    outline: none;
}

.erro-msg {
    background: #1a0000;
    border: 1px solid #f44;
    color: #f88;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 12px;
    text-align: left;
}

/* ── PIN inputs ─────────────────────────────────────── */
.pin-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 20px 0;
}
.pin-digit {
    width: 56px;
    height: 64px;
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    background: #111;
    border: 2px solid #333;
    color: #fff;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    caret-color: transparent;
    -webkit-text-security: disc;  /* bullets no Safari/Chrome */
    font-size: 18px;              /* bullet menor que digito */
    letter-spacing: 2px;
}
.pin-digit:focus,
.pin-digit:focus-visible {
    border-color: #00ff66;
    box-shadow: 0 0 0 2px rgba(0,255,102,0.25);
}
.pin-digit.filled {
    border-color: #555;
    background: #1a1a1a;
}
.pin-cooldown {
    color: #f44;
    font-size: 13px;
    margin-top: 8px;
}

/* ── QR Code ────────────────────────────────────────── */
.qr-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    display: inline-block;
    margin: 16px 0;
}
.qr-wrapper img {
    display: block;
    width: 200px;
    height: 200px;
}
.qr-status {
    font-size: 13px;
    color: #888;
    margin-top: 8px;
}
.qr-timer {
    font-size: 12px;
    color: #555;
    margin-top: 4px;
}

/* ── Checkbox kiosk ─────────────────────────────────── */
.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: 10px;
    gap: 8px;
    font-size: 13px;
    color: #888;
    cursor: pointer;
}
.checkbox-container input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #00ff66;
}

/* ── TV / Tizen ─────────────────────────────────────── */
.tizen-tv .user-card { width: 160px; }
.tizen-tv .pin-digit { width: 64px; height: 72px; font-size: 32px; }
.tizen-tv .btn-primary,
.tizen-tv .btn-google,
.tizen-tv .btn-microsoft,
.tizen-tv .btn-qr { font-size: 18px; padding: 16px; }
.tizen-tv *:focus {
    outline: 3px solid #00ff66 !important;
    outline-offset: 2px !important;
}
