/* css/style.css — Base Reset, Boot Screen, Cozy Login, and Global Animations */

:root {
    --bg-dark: #0a0f1d;
    --bg-surface: #0f172a;
    --bg-window: #1e293b;
    --bg-window-inactive: #141c2c;
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --accent-amber: #38bdf8;
    --accent-gold: #7dd3fc;
    --accent-blue: #38bdf8;
    --accent-indigo: #6366f1;
    --accent-green: #22c55e;
    --accent-red: #ef4444;
    --border-color: #334155;
    --border-light: #475569;
    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-retro: "Courier New", Courier, monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background-color: #000;
    font-family: var(--font-ui);
    color: var(--text-primary);
    image-rendering: pixelated;
    font-size: 14px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Subtle CRT Scanline Effect (non-intrusive) */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99999;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.12) 50%
    ), linear-gradient(
        90deg,
        rgba(255, 0, 0, 0.02),
        rgba(0, 255, 0, 0.01),
        rgba(0, 0, 255, 0.02)
    );
    background-size: 100% 3px, 6px 100%;
    opacity: 0.85;
}

/* Global Utility Classes */
.hidden {
    display: none !important;
}

.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease-out;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.shake {
    animation: shakeAnim 0.35s ease-in-out;
}

@keyframes shakeAnim {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}



/* --- TINY PLAY STARTUP BOOT SCREEN (MAC/WINDOWS TURN-ON STYLE) --- */
#startup-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
    cursor: pointer;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

#startup-screen.fade-out {
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
}

.startup-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.startup-logo-wrapper {
    width: 148px;
    height: 148px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 14px;
    box-shadow: 0 0 45px rgba(255, 255, 255, 0.35), 0 0 100px rgba(255, 255, 255, 0.12);
    animation: startupLogoIntro 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#startup-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
    display: block;
}

/* Minimalist Mac/Windows Style Progress Bar */
.startup-progress-container {
    width: 190px;
    height: 4px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 32px;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.startup-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffffff, #e6e6e6);
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
    transition: width 0.06s linear;
}

.startup-brand-tag {
    margin-top: 18px;
    font-family: var(--font-retro);
    font-size: 0.7rem;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    text-align: center;
    animation: startupTextFade 1.6s ease-out forwards;
}

.startup-skip-hint {
    position: absolute;
    bottom: 28px;
    font-family: var(--font-retro);
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.22);
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0;
    animation: startupHintIn 0.8s ease forwards 1s;
}

@keyframes startupLogoIntro {
    0% {
        opacity: 0;
        transform: scale(0.92);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

@keyframes startupTextFade {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes startupHintIn {
    to {
        opacity: 1;
    }
}

/* --- SIMPLE COZY LOCK SCREEN (WALLPAPER: 8351224.gif) --- */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #0d1117 url('../8351224.gif') no-repeat center center;
    background-size: cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 36px;
    padding: 24px;
    z-index: 9000;
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

#login-screen::-webkit-scrollbar {
    display: none;
}

#login-screen.fade-out {
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
}

/* Subtle dark overlay so wallpaper shines while text stays 100% readable */
.lock-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(10, 15, 25, 0.4) 0%, rgba(5, 8, 15, 0.7) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Minimalist Clean Clock */
.lock-clock-container {
    position: relative;
    z-index: 2;
    text-align: center;
    user-select: none;
}

.lock-digital-time {
    font-family: var(--font-retro);
    font-size: clamp(2.4rem, 10vw, 3.8rem);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 2px;
    line-height: 1;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), 0 0 12px rgba(255, 255, 255, 0.25);
}

.lock-digital-date {
    font-family: var(--font-retro);
    font-size: clamp(0.8rem, 3.2vw, 1rem);
    color: #cbd5e1;
    letter-spacing: 1.5px;
    margin-top: 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

/* Clean Cozy Glassmorphic Login Card */
.login-card {
    position: relative;
    z-index: 2;
    width: 340px;
    max-width: 90vw;
    background: rgba(15, 23, 38, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    padding: 28px 24px 22px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: loginCardPop 0.4s ease-out;
}

@keyframes loginCardPop {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Simple Pixel Avatar */
.login-avatar-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 12px;
    background: #0f172a;
}

.login-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.login-username-label {
    font-family: var(--font-retro);
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 18px;
    letter-spacing: 1px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

/* Form Group */
.login-form-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-input-row {
    width: 100%;
    display: flex;
    gap: 8px;
    align-items: center;
}

.login-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 0 8px 0 12px;
    transition: all 0.2s ease;
}

.login-input-wrapper:focus-within {
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
    background: rgba(0, 0, 0, 0.7);
}

.login-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: var(--font-retro);
    font-size: 0.95rem;
    padding: 10px 0;
    letter-spacing: 1.5px;
}

.login-input::placeholder {
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.login-pwd-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.login-pwd-toggle:hover {
    opacity: 1;
}

.login-submit-btn {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    width: 44px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}

.login-submit-btn:hover {
    background: #38bdf8;
    transform: scale(1.04);
}

.login-submit-btn:active {
    transform: scale(0.96);
}

/* Messages */
.login-error-msg {
    color: #f87171;
    font-family: var(--font-retro);
    font-size: 0.82rem;
    margin-top: 8px;
    min-height: 18px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.login-success-msg {
    color: #34d399;
    font-family: var(--font-retro);
    font-size: 0.88rem;
    font-weight: bold;
    margin-top: 8px;
    min-height: 18px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Clear & Helpful Hint */
.login-hint-row {
    width: 100%;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-hint-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    font-family: var(--font-retro);
}

.login-hint-btn:hover {
    color: #38bdf8;
    background: rgba(255, 255, 255, 0.06);
}

.login-hint-bubble {
    margin-top: 8px;
    width: 100%;
    background: rgba(10, 15, 25, 0.88);
    border: 1px dashed rgba(56, 189, 248, 0.4);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-family: var(--font-retro);
    animation: fadeIn 0.2s ease-out;
}

.hint-body {
    font-size: 0.82rem;
    color: #e2e8f0;
    font-style: italic;
}

.hint-format-tag {
    font-size: 0.8rem;
    color: #38bdf8;
}

.hint-format-tag strong {
    color: #ffffff;
    background: rgba(56, 189, 248, 0.25);
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 1px;
}

.hint-autofill-btn {
    align-self: center;
    margin-top: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-retro);
}

.hint-autofill-btn:hover {
    background: #0ea5e9;
    color: #ffffff;
    border-color: #0ea5e9;
}

/* Reduced Motion Mode */
body.reduced-motion * {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
}

/* ============================================================ */
/* MOBILE PHONE OPTIMIZATION (@media max-width: 768px)          */
/* ============================================================ */
@media (max-width: 768px) {
    #startup-screen {
        height: 100dvh;
    }

    .startup-logo-wrapper {
        width: 120px;
        height: 120px;
        border-radius: 12px;
    }

    .startup-progress-container {
        width: 160px;
        margin-top: 24px;
    }

    .startup-brand-tag {
        font-size: 0.72rem;
        letter-spacing: 2px;
        margin-top: 18px;
    }

    #login-screen {
        height: 100dvh;
        gap: 20px;
        padding: 16px 14px;
        justify-content: center;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .login-card {
        width: 100%;
        max-width: 330px;
        padding: 20px 16px 16px;
        border-radius: 16px;
    }

    .login-avatar-wrapper {
        width: 72px;
        height: 72px;
        margin-bottom: 8px;
    }

    .login-username-label {
        font-size: 1.2rem;
        margin-bottom: 14px;
    }

    .login-input {
        font-size: 16px; /* Prevents iOS auto-zoom on input focus */
        padding: 8px 0;
    }

    .login-submit-btn {
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }

    .login-hint-bubble {
        padding: 8px 10px;
        font-size: 0.78rem;
    }
}
