/* SwiftStream - Authentication Pages Styles - Emby Dark Theme with Animated Background */

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

:root {
    --accent: #52B54B;
    --accent-hover: #43A047;
    --accent-bright: #6CCF65;
    --accent-light: rgba(82, 181, 75, 0.15);
    --bg-primary: #141414;
    --bg-secondary: #1E1E1E;
    --bg-tertiary: #282828;
    --bg-elevated: #333333;
    --text-primary: rgba(255, 255, 255, 0.87);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.38);
    --border: rgba(255, 255, 255, 0.14);
    --danger: #d32f2f;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, ui-sans-serif, system-ui, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: auto;
}

/* ASCII canvas background rendered by background.js sits at z-index: -1 via background.css */

/* ============================================================
   CONTENT LAYER (Z-INDEX: 10)
   ============================================================ */

.auth-container {
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 10;
    animation: fadeIn 0.5s ease-in;
}

.auth-container * {
    pointer-events: auto;
}

#auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

#auth-logo img {
    width: 200px;
    max-width: 100%;
    height: auto;
    display: inline-block;
}

.login-auth-container {
    padding-top: 78px;
}

.login-auth-container #auth-logo {
    position: absolute;
    left: 50%;
    top: 0;
    width: 100%;
    margin-bottom: 0;
    transform: translateX(-50%);
}

.login-auth-container #auth-logo img {
    width: 260px;
}

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

/* Grid animation - no longer used (replaced by ASCII canvas) */
@keyframes gridShift { 0% { background-position: 0 0, 0 0; } 100% { background-position: 50px 50px, -50px 50px; } }

/* Orb glow pulse animation - no longer used */
@keyframes glowPulse { 0%, 100% { opacity: 0.5; filter: blur(40px); } 50% { opacity: 0.8; filter: blur(50px); } }

.auth-card {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 48px 40px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.6);
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.password-toggle .form-input {
    padding-right: 2.75rem;
}

.form-input {
    position: relative;
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s ease;
    background: rgba(40, 40, 40, 0.7);
    color: var(--text-primary);
    font-family: inherit;
    pointer-events: auto;
}

.form-input:focus {
    outline: 2px solid rgba(82, 181, 75, 0.5);
    outline-offset: 2px;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    background: linear-gradient(135deg, #52B54B 0%, #43A047 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(82, 181, 75, 0.3);
    pointer-events: auto;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(82, 181, 75, 0.4);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.status-message {
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 20px;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-message.show {
    display: block;
}

.status-message.success {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.status-message.error {
    background: rgba(211, 47, 47, 0.15);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.auth-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.auth-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.auth-footer-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: #4d9a4d;
    border-right-color: #3d7a3d;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.password-toggle {
    position: relative;
}

.password-toggle-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    transition: color 0.2s ease;
}

.password-toggle-btn:hover {
    color: var(--accent);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: -4px;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.form-checkbox {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--accent);
    cursor: pointer;
    flex: 0 0 auto;
}

.form-help {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .login-auth-container #auth-logo img {
        width: 220px;
    }

    .auth-card {
        padding: 36px 28px;
    }
    
    .auth-title {
        font-size: 24px;
    }
    
    .auth-subtitle {
        font-size: 14px;
    }
}

@media (max-height: 520px) {
    .login-auth-container {
        padding-top: 0;
    }

    .login-auth-container #auth-logo {
        position: static;
        margin-bottom: 18px;
        transform: none;
    }
}

/* Accessibility */
.form-input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.form-checkbox:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
}
