/* ==========================================
   LOGIN.PHP - ishowplay AI Platform
   Design System: Matching signup_layouts.css
   Version: 1.0.0
   Created: 2025-10-31

   Core login page styles using standard design system
   Navigation and background systems aligned with signup.php
   ========================================== */

/* ==========================================
   CSS VARIABLES - Aligned with signup_layouts.css
   ========================================== */

:root {
    /* Light Theme - Matching signup.php exactly */
    --login-background: #f6f8ff;
    --login-surface: rgba(255, 255, 255, 0.92);
    --login-surface-strong: rgba(255, 255, 255, 0.97);
    --login-border: rgba(120, 138, 255, 0.22);
    --login-border-strong: rgba(120, 138, 255, 0.32);
    --login-shadow: 0 48px 120px rgba(133, 144, 255, 0.16);
    --login-text-primary: #111633;
    --login-text-secondary: rgba(22, 29, 60, 0.68);
    --login-text-muted: rgba(22, 29, 60, 0.4);
    --login-accent: #4e6dff;
    --login-accent-soft: rgba(78, 109, 255, 0.15);
    --login-teal: #39cdc2;
    --login-amber: #ffb347;
    --login-white: #ffffff;
    --login-success: #34c759;
    --login-warning: #ff9500;
    --login-error: #ff3b30;
}

/* Dark Theme - Matching signup.php exactly */
[data-theme="dark"] {
    --login-background: #030510;
    --login-surface: rgba(10, 18, 36, 0.88);
    --login-surface-strong: rgba(14, 26, 50, 0.94);
    --login-border: rgba(132, 156, 255, 0.34);
    --login-border-strong: rgba(132, 156, 255, 0.44);
    --login-shadow: 0 70px 170px rgba(2, 4, 10, 0.75);
    --login-text-primary: #f3f7ff;
    --login-text-secondary: rgba(199, 211, 255, 0.86);
    --login-text-muted: rgba(160, 178, 226, 0.7);
    --login-accent: #9bb4ff;
    --login-accent-soft: rgba(155, 180, 255, 0.24);
    --login-teal: #39cdc2;
    --login-amber: #ffb347;
    --login-white: #ffffff;
    --login-success: #32d74b;
    --login-warning: #ff9f0a;
    --login-error: #ff453a;
}

/* ==========================================
   RESET AND BASE STYLES
   ========================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "PingFang TC", "Microsoft JhengHei", sans-serif;
    background: var(--login-background);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--login-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.6s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* ==========================================
   TOP NAVIGATION BAR (Matching signup.php exactly)
   ========================================== */

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    box-shadow: none;
    transition: all 0.3s ease;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.nav-logo:hover {
    opacity: 0.8;
}

/* Logo image styling (matching header.php) */
.nav-logo-full {
    height: 36px;
    width: auto;
    object-fit: contain;
    display: block;
}

.nav-logo-icon {
    display: none;
}

[data-theme="dark"] .nav-logo-full {
    filter: brightness(1.2);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    transform: translateY(-16px);  /* 向上微调，与左侧 logo 对齐 */
}

/* Language Selector - Custom Dropdown (matching signup.php) */
.language-selector {
    position: relative;
    display: inline-block;
}

.language-selector .lang-button {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 18px;
    border-radius: 14px;
    border: 1px solid rgba(142, 169, 255, 0.28);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.26), rgba(244, 248, 255, 0.18));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--login-text-primary);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border 0.25s ease, background 0.25s ease;
    font-size: 14px;
    font-weight: 500;
}

.language-selector .lang-button:hover,
.language-selector.active .lang-button {
    transform: translateY(-1px);
    border-color: rgba(142, 169, 255, 0.45);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.32), rgba(232, 240, 255, 0.26));
    box-shadow: 0 14px 28px rgba(79, 110, 255, 0.18);
}

.language-selector .lang-name {
    font-weight: 500;
}

.language-selector .dropdown-icon {
    transition: transform 0.3s ease;
}

.language-selector.active .dropdown-icon {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--login-surface);
    border: 1px solid var(--login-border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 99999;
    min-width: 180px;
    overflow: hidden;
    display: block;
    pointer-events: none;
}

.language-selector.active .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: var(--login-text-primary);
}

.language-option:hover {
    background: rgba(142, 169, 255, 0.12);
}

.language-option.active {
    background: rgba(142, 169, 255, 0.18);
    color: var(--login-accent);
    font-weight: 600;
}

/* Dark Mode Support for Language Selector */
html[data-theme="dark"] .language-selector .lang-button {
    border-color: rgba(108, 134, 255, 0.32);
    background: linear-gradient(135deg, rgba(24, 32, 60, 0.72), rgba(35, 48, 82, 0.68));
    color: #dbe4ff;
}

html[data-theme="dark"] .language-selector .lang-button:hover,
html[data-theme="dark"] .language-selector.active .lang-button {
    border-color: rgba(126, 156, 255, 0.48);
    background: linear-gradient(135deg, rgba(37, 52, 92, 0.88), rgba(51, 65, 110, 0.84));
    box-shadow: 0 20px 36px rgba(25, 42, 90, 0.45);
}

html[data-theme="dark"] .language-dropdown {
    background: rgba(17, 22, 51, 0.95);
    border-color: rgba(108, 134, 255, 0.25);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .language-option:hover {
    background: rgba(114, 142, 255, 0.2);
}

html[data-theme="dark"] .language-option.active {
    background: rgba(114, 142, 255, 0.28);
    color: #e7ecff;
}

/* Theme toggle section (from header.php) */
.index2-theme-switch-nav {
    display: inline-flex;
    align-items: center;
    margin-right: 12px;
}

/* Theme toggle button - Matching header.php exactly */
.theme-toggle-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 12px 22px 12px 68px;
    border-radius: 999px;
    border: 1px solid rgba(142, 169, 255, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(231, 240, 255, 0.9));
    box-shadow: 0 24px 50px rgba(120, 146, 255, 0.18);
    color: var(--login-text-primary);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, background 0.35s ease;
    overflow: hidden;
}

.theme-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 32px 60px rgba(120, 146, 255, 0.2);
}

.theme-toggle-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(120, 146, 255, 0.25), 0 24px 50px rgba(120, 146, 255, 0.18);
}

.theme-toggle-btn .toggle-handle {
    position: absolute;
    left: 6px;
    top: 50%;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: linear-gradient(135deg, #7aa5ff, #5be6d4);
    box-shadow: 0 18px 30px rgba(90, 140, 255, 0.35);
    transform: translateY(-50%);
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1), background 0.3s ease;
}

.theme-toggle-btn .toggle-icon {
    font-size: 1.4rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scale(1);
}

.theme-toggle-btn .toggle-icon--sun {
    opacity: 1;
}

.theme-toggle-btn .toggle-icon--moon {
    opacity: 0;
    transform: scale(0.5);
}

.theme-toggle-btn.is-dark .toggle-icon--sun {
    opacity: 0;
    transform: scale(0.5);
}

.theme-toggle-btn.is-dark .toggle-icon--moon {
    opacity: 1;
    transform: scale(1);
}

.theme-toggle-btn .toggle-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.theme-toggle-btn .toggle-text strong {
    font-size: 0.95rem;
    font-weight: 700;
}

.theme-toggle-btn .toggle-text span {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Dark mode theme toggle styles */
html[data-theme="dark"] .theme-toggle-btn {
    border-color: rgba(108, 134, 255, 0.35);
    background: linear-gradient(135deg, rgba(26, 35, 68, 0.92), rgba(35, 50, 85, 0.88));
    box-shadow: 0 24px 48px rgba(8, 12, 30, 0.6);
    color: #e8ecff;
}

html[data-theme="dark"] .theme-toggle-btn:hover {
    box-shadow: 0 32px 60px rgba(8, 12, 30, 0.7);
}

html[data-theme="dark"] .theme-toggle-btn .toggle-handle {
    background: linear-gradient(135deg, #384c9f, #2e8b8f);
}

.theme-toggle-btn.is-dark .toggle-handle {
    transform: translateX(calc(100% + 4px)) translateY(-50%);
}

/* Nav divider (optional) */
.nav-divider {
    width: 1px;
    height: 24px;  /* 與 signup.php 一致（從 28px 改為 24px）*/
    background: var(--login-border);
    opacity: 0.6;  /* 與 signup.php 一致 */
    /* 移除 margin: 0 4px; 改用父元素的 gap: 16px */
}

/* Signup Button (matching signup.php auth buttons style) */
.btn-signup {
    padding: 11px 24px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #6f8dff 0%, #45d0c2 100%);
    color: #ffffff;
    font-size: 0.93rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-signup:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(78, 109, 255, 0.35);
}

html[data-theme="dark"] .btn-signup {
    background: linear-gradient(135deg, #5a74ff 0%, #29c5bb 100%);
    color: #ffffff;
}

html[data-theme="dark"] .btn-signup:hover {
    box-shadow: 0 20px 40px rgba(155, 180, 255, 0.3);
}

/* ==========================================
   BACKGROUND SYSTEM - Matching signup.php exactly
   ========================================== */

.login-backdrop {
    position: fixed;
    inset: 0;
    z-index: -10;
    overflow: hidden;
    contain: layout style paint;
    background: radial-gradient(circle at 10% 20%, rgba(102, 140, 255, 0.35), transparent 55%),
                radial-gradient(circle at 85% 28%, rgba(81, 236, 223, 0.32), transparent 52%),
                radial-gradient(circle at 46% 82%, rgba(255, 176, 104, 0.26), transparent 62%),
                linear-gradient(130deg, #040712 0%, #071331 55%, #020513 100%);
    mask-image: radial-gradient(150% 180% at 50% 40%, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.78) 62%, rgba(0, 0, 0, 0.18) 86%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: radial-gradient(150% 180% at 50% 40%, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.78) 62%, rgba(0, 0, 0, 0.18) 86%, rgba(0, 0, 0, 0) 100%);
}

.login-backdrop::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(155, 180, 255, 0.25) 0%, rgba(12, 20, 40, 0) 55%),
        radial-gradient(circle at 78% 68%, rgba(114, 250, 238, 0.18) 0%, rgba(8, 15, 30, 0) 60%);
    opacity: 0.55;
    mix-blend-mode: screen;
    animation: login-aurora-sweep 28s ease-in-out infinite;
    will-change: transform, opacity;
}

/* Light mode backdrop */
html:not([data-theme="dark"]) .login-backdrop {
    background: radial-gradient(circle at 12% 18%, rgba(127, 168, 255, 0.35), transparent 55%),
                radial-gradient(circle at 82% 22%, rgba(137, 234, 226, 0.32), transparent 55%),
                radial-gradient(circle at 45% 80%, rgba(255, 196, 135, 0.25), transparent 60%),
                linear-gradient(135deg, #f7f9ff 0%, #ecf2ff 45%, #f6fbff 100%);
}

html:not([data-theme="dark"]) .login-backdrop::before {
    background:
        radial-gradient(circle at 24% 32%, rgba(101, 143, 255, 0.32) 0%, rgba(255, 255, 255, 0) 58%),
        radial-gradient(circle at 78% 64%, rgba(132, 236, 226, 0.25) 0%, rgba(255, 255, 255, 0) 62%);
    opacity: 0.75;
}

/* Glow effects */
.login-backdrop__glow {
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.65;
    animation: login-glow-drift 22s ease-in-out infinite;
    will-change: transform;
}

.login-backdrop__glow--primary {
    top: -80px;
    right: 15%;
    background: #7fa1ff;
    animation-delay: 0s;
}

.login-backdrop__glow--secondary {
    bottom: -120px;
    left: 12%;
    background: #54f0e4;
    animation-delay: 6s;
}

/* Grid overlay */
.login-backdrop__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
    background-size: 160px 160px;
    opacity: 0.4;
    mask-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.9), transparent 70%);
}

[data-theme="dark"] .login-backdrop__grid {
    background-image:
        linear-gradient(rgba(107, 114, 128, 0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(107, 114, 128, 0.2) 1px, transparent 1px);
}

/* Particles */
.login-backdrop__particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-backdrop__particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(142, 169, 255, 0.55);
    box-shadow: 0 0 12px rgba(120, 154, 255, 0.55);
    animation: login-particles-float 18s linear infinite;
}

.login-backdrop__particles span:nth-child(1) {
    top: 15%; left: 20%;
    animation-duration: 24s;
}

.login-backdrop__particles span:nth-child(2) {
    top: 75%; left: 80%;
    animation-duration: 22s;
    background: rgba(96, 246, 232, 0.6);
    box-shadow: 0 0 14px rgba(96, 246, 232, 0.55);
}

.login-backdrop__particles span:nth-child(3) {
    top: 45%; left: 60%;
    animation-duration: 19s;
}

.login-backdrop__particles span:nth-child(4) {
    top: 90%; left: 10%;
    animation-duration: 26s;
    background: rgba(255, 195, 120, 0.6);
    box-shadow: 0 0 14px rgba(255, 195, 120, 0.55);
}

.login-backdrop__particles span:nth-child(5) {
    top: 10%; left: 90%;
    animation-duration: 20s;
}

.login-backdrop__particles span:nth-child(6) {
    top: 60%; left: 30%;
    animation-duration: 18s;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.65);
}

/* Animations */
@keyframes login-aurora-sweep {
    0% {
        transform: rotate(0deg) scale(1);
        opacity: 0.45;
    }
    40% {
        transform: rotate(12deg) scale(1.05);
        opacity: 0.7;
    }
    70% {
        transform: rotate(-8deg) scale(1.02);
        opacity: 0.55;
    }
    100% {
        transform: rotate(0deg) scale(1);
        opacity: 0.45;
    }
}

@keyframes login-glow-drift {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(18px, -24px, 0) scale(1.05);
    }
}

@keyframes login-particles-float {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    60% {
        opacity: 1;
    }
    100% {
        transform: translate3d(0, -120px, 0) scale(1.4);
        opacity: 0;
    }
}

/* ==========================================
   LOGIN CONTAINER & CARD
   ========================================== */

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 100px 20px 20px; /* Top padding for nav bar */
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: login-container-enter 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Glass Card Effect */
.login-card {
    background: var(--login-surface);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-radius: 32px;
    padding: 48px;
    box-shadow: var(--login-shadow);
    border: 1px solid var(--login-border);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, rgba(155, 180, 255, 0.18), rgba(96, 246, 232, 0.14));
    border-radius: 32px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.login-card:hover::before {
    opacity: 1;
}

/* ==========================================
   LOGO SECTION
   ========================================== */

.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #4e6dff 0%, #39cdc2 100%);
    border-radius: 18px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    font-weight: 700;
    letter-spacing: -1px;
    box-shadow: 0 16px 48px rgba(78, 109, 255, 0.32);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo:hover {
    transform: scale(1.05) rotateY(5deg);
}

h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--login-text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.subtitle {
    font-size: 17px;
    color: var(--login-text-secondary);
    font-weight: 400;
    line-height: 1.4;
}

/* ==========================================
   FORM STYLES
   ========================================== */

.form-group {
    margin-bottom: 16px;
}

.input-wrapper {
    position: relative;
}

input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 16px 18px;
    font-size: 17px;
    border: 1px solid var(--login-border);
    border-radius: 14px;
    background: rgba(23, 36, 74, 0.4);
    color: var(--login-text-primary);
    transition: all 0.3s cubic-bezier(0.21, 0.8, 0.32, 1);
    font-family: inherit;
    -webkit-appearance: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

html:not([data-theme="dark"]) input[type="email"],
html:not([data-theme="dark"]) input[type="password"] {
    background: rgba(244, 247, 255, 0.92);
}

input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--login-accent);
    background: var(--login-surface-strong);
    box-shadow: 0 0 0 4px var(--login-accent-soft);
    transform: translateY(-1px);
}

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

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--login-text-secondary);
    transition: color 0.2s ease;
    padding: 4px;
}

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

/* Remember & Forgot Section */
.options-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--login-accent);
}

.checkbox-label {
    font-size: 15px;
    color: var(--login-text-primary);
    user-select: none;
}

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

.forgot-link:hover {
    opacity: 0.7;
}

/* ==========================================
   BUTTONS (Matching signup.php style)
   ========================================== */

/* Primary Button */
.btn-primary {
    width: 100%;
    padding: 16px;
    font-size: 17px;
    font-weight: 600;
    color: var(--login-white);
    background: linear-gradient(135deg, rgba(63, 109, 255, 0.95), rgba(87, 218, 204, 0.9));
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.21, 0.8, 0.32, 1);
    box-shadow: 0 18px 44px rgba(63, 109, 255, 0.24);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 36px 80px rgba(63, 109, 255, 0.35);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(-1px);
}

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

.btn-primary.loading {
    color: transparent;
    pointer-events: none;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: login-btn-spin 0.8s linear infinite;
}

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

html[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, rgba(155, 180, 255, 0.92), rgba(87, 218, 204, 0.88));
    box-shadow: 0 18px 44px rgba(155, 180, 255, 0.24);
}

html[data-theme="dark"] .btn-primary:hover:not(:disabled) {
    box-shadow: 0 36px 80px rgba(155, 180, 255, 0.35);
}

/* ==========================================
   DIVIDER & SOCIAL BUTTONS
   ========================================== */

/* Divider */
.divider {
    text-align: center;
    margin: 32px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--login-border);
}

.divider span {
    background: var(--login-surface);
    padding: 0 20px;
    font-size: 14px;
    color: var(--login-text-secondary);
    position: relative;
    font-weight: 500;
}

/* Social Buttons */
.social-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.btn-social {
    flex: 1;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid var(--login-border);
    border-radius: 14px;
    background: var(--login-surface);
    color: var(--login-text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.btn-social:hover {
    background: var(--login-surface-strong);
    border-color: var(--login-accent);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(78, 109, 255, 0.18);
}

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

.social-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Apple Sign In Button */
.btn-apple {
    background: var(--login-surface);
    color: var(--login-surface);
    border-color: var(--login-text-primary);
}

.btn-apple:hover {
    background: var(--login-text-secondary);
    border-color: var(--login-text-secondary);
    box-shadow: 0 12px 32px rgba(17, 22, 51, 0.25);
}

/* Apple icon: Force black in light mode */
html:not([data-theme="dark"]) .btn-apple .social-icon {
    filter: brightness(0);
}

html[data-theme="dark"] .btn-apple {
    background: var(--login-surface);
    color: #ffffff;
    border-color: rgba(132, 156, 255, 0.3);
}

html[data-theme="dark"] .btn-apple:hover {
    background: #e8ecff;
    border-color: #e8ecff;
}

/* Apple icon: Force white in dark mode */
html[data-theme="dark"] .btn-apple .social-icon {
    filter: brightness(0) invert(1);
}

/* ==========================================
   REGISTER SECTION
   ========================================== */

.register-section {
    text-align: center;
    font-size: 15px;
    color: var(--login-text-secondary);
}

.register-section a {
    color: var(--login-accent);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.register-section a:hover {
    opacity: 0.7;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 768px) {
    .top-nav {
        padding: 10px 15px;
        height: 72px; /* Align vertical spacing with signup nav */
    }

    .nav-logo-full {
        display: none;
    }

    .nav-logo-icon {
        display: block;
        width: 40px;
        height: 40px;
    }

    .nav-actions {
        gap: 8px;
    }

    .index2-theme-switch-nav {
        margin-right: 8px;
    }

    .theme-toggle-btn {
        width: 56px;
        height: 56px;
        padding: 0;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    .theme-toggle-btn .toggle-handle,
    .theme-toggle-btn .toggle-text {
        display: none;
    }

    .theme-toggle-btn .toggle-icon {
        position: static;
        font-size: 1.5rem;
        opacity: 1 !important;
        transform: none !important;
    }

    .theme-toggle-btn .toggle-icon--moon {
        display: none;
    }

    .theme-toggle-btn.is-dark .toggle-icon--sun,
    html[data-theme="dark"] .theme-toggle-btn .toggle-icon--sun {
        display: none;
    }

    .theme-toggle-btn.is-dark .toggle-icon--moon,
    html[data-theme="dark"] .theme-toggle-btn .toggle-icon--moon {
        display: block;
    }

    .language-selector .lang-button {
        padding: 8px 10px;
        font-size: 13px;
    }

    .btn-signup {
        padding: 8px 16px;
        font-size: 13px;
        border-radius: 14px;
    }

    .nav-divider {
        display: none;
    }

    .login-card {
        padding: 32px 24px;
    }

    h1 {
        font-size: 28px;
    }

    .subtitle {
        font-size: 16px;
    }

    .social-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .top-nav {
        padding: 0 16px;
    }

    .language-selector .lang-button {
        padding: 6px 8px;
        font-size: 12px;
    }

    .btn-signup {
        padding: 6px 12px;
        font-size: 12px;
    }

    .login-container {
        padding: 80px 12px 12px;
    }

    .login-card {
        padding: 28px 20px;
        border-radius: 24px;
    }

    h1 {
        font-size: 24px;
    }

    input[type="email"],
    input[type="password"],
    .btn-primary {
        font-size: 16px;
        padding: 14px 16px;
    }

    .options-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

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

/* Focus Visible */
*:focus-visible {
    outline: 2px solid var(--login-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--login-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--login-text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--login-text-secondary);
}
