/* =========================================
   NEW "PIN CODE" LOGIN THEME - 4 BOX INPUT
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;600;800&display=swap');

:root {
    --bg-color: #0f0f12;
    --card-bg: #18181b;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --border: #3f3f46;
    
    /* Device Specific Colors */
    --mobile-accent: #06b6d4; /* Cyan */
    --pc-accent: #8b5cf6;     /* Purple */
    --tv-accent: #e50914;     /* Red */
}

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

body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.1); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* Header */
header {
    padding: 24px;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 15, 18, 0.8);
    backdrop-filter: blur(10px);
}

.brand-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
}

/* Main Content */
.login-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    animation: fadeIn 0.6s ease-out;
}

/* Abstract Background Elements */
.bg-blob {
    position: absolute;
    width: 300px;
    height: 300px;
    filter: blur(150px);
    opacity: 0.15;
    border-radius: 50%;
    z-index: -1;
}
.blob-1 { top: 10%; left: 20%; }
.blob-2 { bottom: 10%; right: 20%; }

/* Login Card */
.login-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 48px;
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* Avatar / Icon */
.avatar-container {
    width: 90px;
    height: 90px;
    margin: 0 auto 24px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-bg {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    opacity: 0.2;
    animation: pulse 2s infinite;
}

.avatar-icon {
    font-size: 2.5rem;
    position: relative;
    z-index: 1;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 32px;
    line-height: 1.5;
}

/* 4-Box Input Styling (Adjusted for 4 digits) */
.pin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 32px;
    /* Added max-width and margin auto to keep boxes from becoming too huge */
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.pin-box {
    width: 100%;
    aspect-ratio: 1;
    background: #27272a;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: all 0.2s;
    /* Hide blinking cursor */
    caret-color: transparent; 
}

.pin-box:focus {
    border-color: white;
    background: #3f3f46;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Hidden input that actually captures the value */
.hidden-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Button */
.btn-submit {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: none;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-submit:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Error */
.error-alert {
    background: rgba(220, 38, 38, 0.1);
    color: #ef4444;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

/* Footer */
footer {
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    background: #0f0f12;
}

footer a { color: var(--text-secondary); text-decoration: none; }
footer a:hover { color: white; }

/* THEMES */
/* Mobile (Cyan) */
.theme-mobile { --accent: var(--mobile-accent); }
.theme-mobile .avatar-bg { background: var(--accent); }
.theme-mobile .avatar-icon { color: var(--accent); }
.theme-mobile .pin-box:focus { border-color: var(--accent); }
.theme-mobile .btn-submit { background: linear-gradient(135deg, #06b6d4, #0891b2); box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3); }
.theme-mobile .bg-blob { background: var(--accent); }

/* PC (Purple) */
.theme-pc { --accent: var(--pc-accent); }
.theme-pc .avatar-bg { background: var(--accent); }
.theme-pc .avatar-icon { color: var(--accent); }
.theme-pc .pin-box:focus { border-color: var(--accent); }
.theme-pc .btn-submit { background: linear-gradient(135deg, #8b5cf6, #7c3aed); box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.theme-pc .bg-blob { background: var(--accent); }

/* TV (Red) */
.theme-tv { --accent: var(--tv-accent); }
.theme-tv .avatar-bg { background: var(--accent); }
.theme-tv .avatar-icon { color: var(--accent); }
.theme-tv .pin-box:focus { border-color: var(--accent); }
.theme-tv .btn-submit { background: linear-gradient(135deg, #ef4444, #b91c1c); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.theme-tv .bg-blob { background: var(--accent); }

/* Responsive */
@media (max-width: 480px) {
    .login-box { padding: 32px 20px; }
    .pin-grid { gap: 6px; }
    .pin-box { border-radius: 8px; font-size: 1.2rem; }
}