/* ---------- CSS Variables for Theme ---------- */
:root {
    --bg-primary: #0b0c10;
    --bg-secondary: rgba(255, 255, 255, 0.06);
    --text-primary: #ffffff;
    --text-secondary: #b0b0d0;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(0, 0, 0, 0.25);
    --shadow-color: rgba(0, 0, 0, 0.6);
    --input-bg: rgba(255, 255, 255, 0.07);
    --accent: #6c63ff;
    --accent-gradient: linear-gradient(135deg, #6c63ff, #5848c0);
}

[data-theme="light"] {
    --bg-primary: #f0f2f5;
    --bg-secondary: rgba(0, 0, 0, 0.04);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --border-color: rgba(0, 0, 0, 0.1);
    --card-bg: rgba(255, 255, 255, 0.8);
    --shadow-color: rgba(0, 0, 0, 0.15);
    --input-bg: rgba(0, 0, 0, 0.05);
}

/* ---------- Global Reset ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    overflow: hidden;
}

/* ---------- Background ---------- */
.slider-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #0b0c10 0%, #1a1a2e 50%, #14152b 100%);
}

[data-theme="light"] .slider-bg {
    background: linear-gradient(135deg, #f0f2f5 0%, #e8eaf6 50%, #eef0ff 100%);
}

/* ---------- Main Container ---------- */
.container {
    width: 100%;
    max-width: 1100px;
    height: 90vh;
    background: var(--bg-secondary);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 40px;
    box-shadow: 0 25px 50px var(--shadow-color);
    display: flex;
    flex-direction: column;
    padding: 20px 35px;
    position: relative;
    border: 1px solid var(--border-color);
    overflow-y: auto;
}

/* ---------- Top Bar ---------- */
.top-bar {
    position: absolute;
    top: 25px;
    right: 35px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
}

.lang-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    background: var(--card-bg);
    padding: 8px 16px 8px 14px;
    border-radius: 40px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(4px);
}

.lang-selector select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lang-selector select option {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ---------- Brand ---------- */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

.brand .logo-icon {
    background: rgba(108, 99, 255, 0.18);
    padding: 6px;
    border-radius: 18px;
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand .logo-icon img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: block;
    object-fit: cover;
}

.brand h1 {
    font-size: 1.9rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.brand span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 4px;
    font-weight: 300;
    -webkit-text-fill-color: var(--text-secondary);
}

/* ---------- Navigation Tabs ---------- */
.nav-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0 12px 0;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}
.nav-tabs .lang-selector {
    margin-left: auto;
}

.nav-tabs button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.25s;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-tabs button:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-tabs button.active {
    background: rgba(108, 99, 255, 0.25);
    color: var(--text-primary);
    box-shadow: 0 0 15px rgba(108, 99, 255, 0.15);
}

/* ---------- Pages ---------- */
.page {
    display: none;
    flex: 1;
    padding: 12px 0 10px 0;
    animation: fadeUp 0.35s ease;
}

.page.active {
    display: block;
}

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

/* ---------- Login Page ---------- */
.login-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    height: 100%;
    align-items: center;
}

.login-left h2 {
    font-size: 2.2rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 6px;
}

.login-left p {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 1rem;
}

.register-link {
    margin-top: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.register-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover {
    text-decoration: underline;
}

.input-group {
    margin-bottom: 18px;
    position: relative;
}

.input-group label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: 0.25s;
}

.input-group input:focus {
    border-color: var(--accent);
    background: var(--input-bg);
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.15);
}

.input-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0 22px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.login-options a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: 0.2s;
    cursor: pointer;
}

.login-options a:hover {
    color: var(--accent);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 40px;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.4);
}

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

.login-right {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.daily-wallpaper {
    width: 100%;
    height: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: 32px;
    box-shadow: 0 20px 60px rgba(108, 99, 255, 0.25);
    border: 1px solid var(--border-color);
}

/* ---------- Auth Cards ---------- */
.auth-card {
    max-width: 480px;
    margin: 20px auto;
    background: var(--card-bg);
    padding: 32px 36px;
    border-radius: 32px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(4px);
}

.auth-card h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.auth-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* ---------- Messages ---------- */
.msg {
    color: #b0d0b0;
    background: rgba(0, 200, 100, 0.1);
    padding: 10px 16px;
    border-radius: 12px;
    border-left: 4px solid #4caf50;
    margin: 12px 0;
    font-size: 0.9rem;
}

.msg.error {
    color: #f0a0a0;
    border-left-color: #e74c3c;
    background: rgba(200, 0, 0, 0.08);
}

.back-link {
    display: inline-block;
    margin-top: 18px;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--accent);
}

/* ---------- About & Why ---------- */
.about-grid, .why-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 12px;
}

.about-grid .text h2, .why-grid h2 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 12px;
}

.about-grid .text p, .why-grid p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
}

.why-item {
    background: var(--bg-secondary);
    padding: 22px 24px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    transition: 0.25s;
}

.why-item:hover {
    background: var(--input-bg);
    transform: translateY(-4px);
}

.why-item i {
    font-size: 2.2rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.why-item h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.why-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ---------- Loading Spinner ---------- */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 850px) {
    .login-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .login-right {
        display: none;
    }
    .about-grid, .why-grid {
        grid-template-columns: 1fr;
    }
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        padding: 16px 0;
    }
    .container {
        padding: 16px 20px;
        height: auto;
        min-height: 0;
        max-height: none;
        border-radius: 28px;
        overflow-y: visible;
    }
    /* The top-bar was absolutely positioned and overlapped the brand/title
       on small screens once it wrapped to two rows. Put it back into normal
       document flow so the rest of the page is pushed down instead. */
    .top-bar {
        position: static;
        justify-content: flex-end;
        margin-bottom: 14px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    .brand {
        margin-top: 0;
        flex-wrap: wrap;
    }
    .brand h1 {
        font-size: 1.5rem;
    }
    .lang-selector {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    .nav-tabs button {
        font-size: 0.8rem;
        padding: 6px 14px;
    }
    .auth-card {
        padding: 24px 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }
    .container {
        border-radius: 0;
        padding: 14px 14px;
        width: 100%;
    }
    .top-bar {
        justify-content: space-between;
        width: 100%;
        flex-wrap: wrap;
        row-gap: 8px;
    }
    .lang-selector select {
        max-width: 68px;
    }
    .brand .logo-icon {
        padding: 5px;
    }
    .brand .logo-icon img {
        width: 32px;
        height: 32px;
    }
    .brand h1 {
        font-size: 1.3rem;
    }
    .brand span {
        display: block;
        margin-left: 0;
    }
    .login-left h2 {
        font-size: 1.6rem;
    }
    .nav-tabs {
        gap: 4px;
    }
    .nav-tabs button {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    .auth-card {
        padding: 20px 16px;
        margin: 12px auto;
        border-radius: 20px;
    }
    .why-item {
        padding: 18px 16px;
    }
}
/* ---------- "Continue as [Name]" remembered-profile screen ---------- */
.remembered-profile {
    text-align: center;
}
.remembered-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    margin: 10px auto 14px;
    display: block;
    border: 3px solid var(--accent);
}
.remembered-profile h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}
.remembered-profile form {
    text-align: left;
}

/* ---------- Colorful interactive slide-show (Why Choose Us / About) ---------- */
.slideshow-wrap {
    position: relative;
    max-width: 720px;
    margin: 24px auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.slideshow-track {
    display: flex;
    transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.slide {
    flex: 0 0 100%;
    min-height: 360px;
    padding: 44px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}
.slide-icon {
    font-size: 3.2rem;
    margin-bottom: 18px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.2));
}
.slide h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 12px;
}
.slide p {
    font-size: 1rem;
    line-height: 1.6;
    max-width: 480px;
    opacity: 0.96;
}
.slide .slide-tag {
    display: inline-block;
    margin-top: 16px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,0.22);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
/* Gradient palette, one per slide position, cycling if there are more
   slides than colors - gives each slide a distinct, colorful identity. */
.slide-grad-1 { background: linear-gradient(135deg, #6C63FF 0%, #4A3FE0 100%); }
.slide-grad-2 { background: linear-gradient(135deg, #FF6B6B 0%, #E84545 100%); }
.slide-grad-3 { background: linear-gradient(135deg, #16A085 0%, #0E7C6B 100%); }
.slide-grad-4 { background: linear-gradient(135deg, #F39C12 0%, #E67E22 100%); }
.slide-grad-5 { background: linear-gradient(135deg, #3498DB 0%, #2874A6 100%); }
.slide-grad-6 { background: linear-gradient(135deg, #9B59B6 0%, #7D3C98 100%); }
.slide-grad-7 { background: linear-gradient(135deg, #1ABC9C 0%, #16A085 100%); }
.slide-grad-8 { background: linear-gradient(135deg, #E91E8C 0%, #C2185B 100%); }

.slideshow-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.25);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.slideshow-nav:hover { background: rgba(255,255,255,0.4); }
.slideshow-nav.prev { left: 12px; }
.slideshow-nav.next { right: 12px; }

.slideshow-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 0;
    background: var(--bg-secondary, #fff);
}
.slideshow-dots button {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: none;
    background: #d0d3d9;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.slideshow-dots button.active {
    background: var(--accent);
    transform: scale(1.35);
}
@media (max-width: 600px) {
    .slide { min-height: 320px; padding: 34px 22px; }
    .slide-icon { font-size: 2.6rem; }
    .slide h3 { font-size: 1.25rem; }
    .slide p { font-size: 0.92rem; }
}
