:root {
    --auth-bg-start: #07122d;
    --auth-bg-end: #050810;
    --auth-card: rgba(10, 22, 44, 0.88);
    --auth-card-border: rgba(255, 255, 255, 0.10);
    --auth-card-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
    --auth-input-bg: rgba(255, 255, 255, 0.06);
    --auth-input-border: rgba(255, 255, 255, 0.14);
    --auth-text: #f8fafc;
    --auth-muted: rgba(255, 255, 255, 0.72);
    --auth-muted-strong: rgba(255, 255, 255, 0.86);
    --auth-button: #ffc107;
    --auth-button-dark: #ffb300;
    --auth-button-hover: #ffca28;
    --auth-accent: #ffd54f;
}

body.auth-layout {
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(30, 140, 255, 0.22), transparent 24%),
                radial-gradient(circle at top right, rgba(255, 193, 7, 0.18), transparent 14%),
                linear-gradient(180deg, var(--auth-bg-start) 0%, var(--auth-bg-end) 100%);
    color: var(--auth-text);
    position: relative;
    overflow-x: hidden;
}

body.auth-layout::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 15% 15%, rgba(255, 235, 59, 0.08), transparent 18%),
                radial-gradient(circle at 85% 20%, rgba(59, 130, 246, 0.10), transparent 15%);
    pointer-events: none;
    z-index: -1;
}

.auth-page-wrapper,
.register-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.login-box,
.auth-container,
.reset-box,
.admin-login-box {
    width: 100%;
    max-width: 540px;
    padding: 36px;
    border-radius: 24px;
    background: var(--auth-card) !important;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--auth-card-border) !important;
    box-shadow: var(--auth-card-shadow) !important;
    color: var(--auth-text) !important;
}

.login-header,
.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header h1,
.auth-header h1,
.reset-box h1,
.login-box h1,
.auth-container h1 {
    margin: 0 0 10px;
    color: var(--auth-accent);
    font-size: 2rem;
    line-height: 1.1;
    letter-spacing: 0.02em;
}

.login-header p,
.auth-header p,
.reset-box p,
.auth-container p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 0.98rem;
}

.field,
.form-group {
    margin-bottom: 20px;
}

.field label,
.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--auth-muted-strong);
    font-size: 0.95rem;
    font-weight: 600;
}

.login-box input,
.auth-container input,
.reset-box input,
.login-box textarea,
.auth-container textarea,
.reset-box textarea,
.login-box select,
.auth-container select,
.reset-box select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--auth-input-border);
    background: var(--auth-input-bg);
    color: var(--auth-text);
    font-size: 1rem;
    transition: border-color 0.25s ease, transform 0.2s ease;
    box-sizing: border-box;
}

.login-box input:focus,
.auth-container input:focus,
.reset-box input:focus,
.login-box textarea:focus,
.auth-container textarea:focus,
.reset-box textarea:focus,
.login-box select:focus,
.auth-container select:focus,
.reset-box select:focus {
    outline: none;
    border-color: rgba(255, 193, 7, 0.8);
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.login-box input::placeholder,
.auth-container input::placeholder,
.reset-box input::placeholder,
.login-box textarea::placeholder,
.auth-container textarea::placeholder,
.reset-box textarea::placeholder {
    color: rgba(255, 255, 255, 0.68);
    opacity: 1;
}

.btn-primary,
.btn-submit,
.login-btn {
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 46%, #ff9800 100%);
    color: #08121b;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-primary:hover,
.btn-submit:hover,
.login-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-primary:disabled,
.btn-submit:disabled,
.login-btn:disabled {
    background: rgba(255, 193, 7, 0.35);
    cursor: not-allowed;
}

.footer-links,
.auth-footer-section,
.back-link {
    text-align: center;
    margin-top: 20px;
}

.footer-links a,
.auth-footer-link,
.back-link a {
    color: #ffd54f;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer-links a:hover,
.auth-footer-link:hover,
.back-link a:hover {
    opacity: 0.9;
    text-decoration: underline;
}

.footer-links span {
    color: rgba(255, 255, 255, 0.68);
}

.auth-footer-section {
    margin-top: 22px;
    border-top: 1px solid rgba(255,255,255,0.10);
    padding-top: 18px;
}

.auth-footer-text {
    display: block;
    color: rgba(255,255,255,0.84);
    font-size: 0.95rem;
}

.auth-footer-link {
    color: #ffd54f;
    font-weight: 700;
}

.auth-layout .alert {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.auth-layout .alert.error {
    background: rgba(255, 70, 70, 0.12);
    border-color: rgba(255, 70, 70, 0.28);
    color: #ffccd5;
}

.auth-layout .alert.success {
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.28);
    color: #bbdefb;
}

.auth-layout .alert.info {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.28);
    color: #bfdbfe;
}

.auth-layout .auth-header-btn,
.auth-layout .lang-btn,
.auth-layout .theme-btn {
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.08);
    color: var(--auth-text);
}

.auth-layout .auth-header-btn:hover,
.auth-layout .lang-btn:hover,
.auth-layout .theme-btn:hover {
    background: rgba(255,255,255,0.14);
}

/* Alternate box class names for register page */
.register-page-wrapper {
    min-height: 80vh;
}

.auth-container {
    width: 100%;
    max-width: 520px;
    margin: 40px auto;
    padding: 40px;
    background: var(--auth-card) !important;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--auth-card-border) !important;
    border-radius: 24px;
    box-shadow: var(--auth-card-shadow) !important;
    color: var(--auth-text) !important;
}

/* Login page header styles */
.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header h1 {
    margin: 0 0 10px;
    color: var(--auth-accent);
    font-size: 2rem;
    line-height: 1.1;
}

.login-header p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 0.98rem;
}

/* Footer links for login page */
.footer-links {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.10);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.footer-links a {
    display: inline-block;
    margin: 0 8px;
    color: #ffd54f;
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.2s ease;
}

.footer-links a:hover {
    opacity: 0.9;
    text-decoration: underline;
}

.footer-links span {
    color: rgba(255,255,255,0.68);
}

/* Registration page steps */
.steps {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 30px;
    position: relative;
    padding: 0 4px;
}

.steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 24px;
    right: 24px;
    height: 4px;
    background: rgba(255, 255, 255, 0.14);
    z-index: 0;
    transform: translateY(-50%);
}

.step {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    display: grid;
    place-items: center;
    font-weight: 800;
    color: rgba(255,255,255,0.68);
    position: relative;
    z-index: 1;
}

.step.active {
    background: #ffc107;
    color: #08121b;
    border-color: #ffc107;
}

.step.active::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(255, 193, 7, 0.2);
}

/* Form elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--auth-muted-strong);
    font-size: 0.95rem;
    font-weight: 600;
}

.form-group input.otp {
    font-size: 20px;
    letter-spacing: 6px;
    text-align: center;
    font-weight: bold;
    font-family: monospace;
}

.form-group .hint {
    font-size: 13px;
    color: var(--auth-muted);
    margin-top: 6px;
}

/* Error/Success alerts */
.error {
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: #ffccd5;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #ff6464;
}

.alert.success {
    background: rgba(100, 200, 100, 0.1);
    border: 1px solid rgba(100, 200, 100, 0.3);
    color: #bbdefb;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #64c864;
}

.alert.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #bfdbfe;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #3b82f6;
}

/* Footer text for forms */
.footer-text {
    text-align: center;
    margin-top: 20px;
    color: var(--auth-muted);
    font-size: 14px;
}

.footer-text a,
.footer-text button {
    color: #ffd54f;
    text-decoration: none;
    font-weight: 600;
}

.footer-text button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
}

.footer-text a:hover,
.footer-text button:hover {
    text-decoration: underline;
    opacity: 0.9;
}

/* Timer display */
.timer {
    text-align: center;
    color: var(--auth-muted);
    margin: 15px 0;
    font-size: 14px;
}

.timer strong {
    color: #ffd54f;
    font-size: 16px;
}

/* Password strength indicator */
.password-strength {
    margin-top: 5px;
    font-size: 12px;
    display: none;
}

.password-strength.weak {
    color: #ffccd5;
}

.password-strength.medium {
    color: #ffe082;
}

.password-strength.strong {
    color: #a5d6a7;
}

/* Error messages */
.error-message {
    color: #ffccd5;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

/* Back link */
.back-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.10);
}

.back-link a {
    color: #ffd54f;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.back-link a:hover {
    opacity: 0.9;
    text-decoration: underline;
}

/* Light mode adjustments */
body.light-mode {
    --auth-bg-start: #eef2ff;
    --auth-bg-end: #f8fafc;
    --auth-card: rgba(255, 253, 248, 0.97);
    --auth-card-border: rgba(0, 0, 0, 0.10);
    --auth-card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --auth-input-bg: rgba(0, 0, 0, 0.04);
    --auth-input-border: rgba(0, 0, 0, 0.16);
    --auth-text: #1e293b;
    --auth-muted: rgba(0, 0, 0, 0.56);
    --auth-muted-strong: rgba(0, 0, 0, 0.78);
    --auth-accent: #c05500;
}

body.light-mode.auth-layout {
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 24%),
                radial-gradient(circle at top right, rgba(255, 193, 7, 0.10), transparent 14%),
                linear-gradient(180deg, var(--auth-bg-start) 0%, var(--auth-bg-end) 100%);
    color: var(--auth-text);
}

body.light-mode.auth-layout::before {
    background: none;
}

body.light-mode .auth-container,
body.light-mode .login-box,
body.light-mode .reset-box,
body.light-mode .admin-login-box {
    background: var(--auth-card) !important;
    border-color: var(--auth-card-border) !important;
    box-shadow: var(--auth-card-shadow) !important;
    color: var(--auth-text) !important;
}

body.light-mode .login-box input,
body.light-mode .auth-container input,
body.light-mode .reset-box input,
body.light-mode .login-box textarea,
body.light-mode .auth-container textarea,
body.light-mode .reset-box textarea,
body.light-mode .login-box select,
body.light-mode .auth-container select,
body.light-mode .reset-box select {
    background: var(--auth-input-bg);
    border-color: var(--auth-input-border);
    color: var(--auth-text);
}

body.light-mode .login-box input::placeholder,
body.light-mode .auth-container input::placeholder,
body.light-mode .reset-box input::placeholder {
    color: rgba(0, 0, 0, 0.38);
    opacity: 1;
}

body.light-mode .login-box input:focus,
body.light-mode .auth-container input:focus,
body.light-mode .reset-box input:focus {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(255, 153, 0, 0.8);
}

body.light-mode .footer-links a,
body.light-mode .auth-footer-link,
body.light-mode .back-link a,
body.light-mode .footer-text a,
body.light-mode .footer-text button {
    color: #b34700;
}

body.light-mode .footer-links span,
body.light-mode .auth-footer-text {
    color: rgba(0, 0, 0, 0.56);
}

body.light-mode .auth-footer-section {
    border-top-color: rgba(0, 0, 0, 0.10);
}

body.light-mode .footer-links {
    border-top-color: rgba(0, 0, 0, 0.10);
}

body.light-mode .back-link {
    border-top-color: rgba(0, 0, 0, 0.10);
}

body.light-mode .timer {
    color: var(--auth-muted);
}

body.light-mode .timer strong {
    color: #b34700;
}

body.light-mode .loading {
    color: var(--auth-muted);
}

body.light-mode.auth-layout .alert {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.10);
    color: #1e293b;
}

body.light-mode.auth-layout .alert.error {
    background: rgba(220, 38, 38, 0.10);
    border: 1px solid rgba(220, 38, 38, 0.35);
    border-left: 4px solid #dc2626;
    color: #991b1b;
}

body.light-mode.auth-layout .alert.success {
    background: rgba(21, 128, 61, 0.10);
    border: 1px solid rgba(21, 128, 61, 0.35);
    border-left: 4px solid #16a34a;
    color: #14532d;
}

body.light-mode.auth-layout .alert.info {
    background: rgba(37, 99, 235, 0.10);
    border: 1px solid rgba(37, 99, 235, 0.30);
    border-left: 4px solid #2563eb;
    color: #1e40af;
}

body.light-mode .error-message {
    color: #b91c1c;
}

body.light-mode .step {
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}

body.light-mode .step.active {
    background: #ffc107;
    color: #08121b;
}

body.light-mode .steps::before {
    background: rgba(0, 0, 0, 0.12);
}

body.light-mode .auth-layout .auth-header-btn,
body.light-mode .auth-layout .lang-btn,
body.light-mode .auth-layout .theme-btn {
    border-color: rgba(0, 0, 0, 0.14);
    background: rgba(0, 0, 0, 0.06);
    color: var(--auth-text);
}

@media (max-width: 620px) {
    .auth-page-wrapper,
    .register-page-wrapper {
        padding: 16px;
    }
    .login-box,
    .auth-container,
    .reset-box,
    .admin-login-box {
        padding: 28px;
        border-radius: 22px;
    }
    .login-header h1,
    .auth-header h1,
    .reset-box h1 {
        font-size: 1.75rem;
    }
    .btn-primary,
    .btn-submit,
    .login-btn {
        font-size: 0.98rem;
    }
    .steps {
        display: none;
    }
}



/* Loading message container */
.loading {
    display: none;
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    color: var(--auth-muted);
    font-size: 14px;
}

.loading.active {
    display: block;
}

/* Spinner used on auth forms */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary, #ff9800);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Small utility for inline action buttons in auth forms */
.btn-inline {
    width: auto;
    display: inline;
    padding: 0;
    background: none;
    color: var(--primary);
    border: none;
    cursor: pointer;
}

.btn-inline[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.resend-inline { margin: 0 5px; }

/* Auth page header customization: show only logo, name, theme, and language toggles */
body.auth-layout .header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Hide login nav item on auth pages, but keep auth form buttons visible */
body.auth-layout #nav-login {
    display: none !important;
}

/* Hide user menu on auth pages */
body.auth-layout .user-menu {
    display: none !important;
}

/* Show only lang and theme toggles */
body.auth-layout .lang-btn.desktop-header-control,
body.auth-layout .theme-btn {
    display: inline-block !important;
}

/* Hide mobile menu on auth pages */
body.auth-layout .mobile-header-menu {
    display: none !important;
}
