:root {
    --saffron:        #C8860A;
    --saffron-light:  #F0A500;
    --saffron-pale:   #FFF3D6;
    --maroon:         #7B1C1C;
    --maroon-light:   #A83232;
    --cream:          #FDF6E3;
    --cream-dark:     #F5E6C0;
    --brown-dark:     #3B2005;
    --brown-mid:      #6B3A1F;
    --brown-light:    #C4956A;
    --text-primary:   #2C1A0E;
    --text-secondary: #6B4C2A;
}

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

body {
    min-height: 100vh;
    background: var(--brown-dark);
    font-family: 'Cormorant Garamond', serif;
    overflow-x: hidden;
    position: relative;
}

/* ── ANIMATED BACKGROUND ── */
.bg-layer {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(200,134,10,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 90%, rgba(123,28,28,0.15) 0%, transparent 60%),
        radial-gradient(ellipse 100% 100% at 50% 50%, #2A1504 0%, #1A0A02 100%);
    z-index: 0;
}

/* Subtle mandala pattern overlay */
.bg-pattern {
    position: fixed;
    inset: 0;
    background-image:
        repeating-conic-gradient(
            from 0deg at 50% 50%,
            rgba(200,134,10,0.015) 0deg 10deg,
            transparent 10deg 20deg
        );
    z-index: 0;
}

/* Floating particles */
.particle {
    position: fixed;
    width: 2px;
    height: 2px;
    background: var(--saffron);
    border-radius: 50%;
    opacity: 0;
    animation: float-up linear infinite;
}

@keyframes float-up {
    0%   { transform: translateY(100vh) translateX(0); opacity: 0; }
    10%  { opacity: 0.6; }
    90%  { opacity: 0.2; }
    100% { transform: translateY(-10vh) translateX(30px); opacity: 0; }
}

/* ── MAIN LAYOUT ── */
.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;
}

/* ── lotus-icon ── */
.lotus-wrap {
    margin-bottom: 28px;
    /* animation: gentle-spin 40s linear infinite; */
    filter: drop-shadow(0 0 20px rgba(200,134,10,0.4));
}

@keyframes gentle-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.lotus-wrap svg {
    width: 72px;
    height: 72px;
}

/* ── TITLE SECTION ── */
.title-section {
    text-align: center;
    margin-bottom: 20px;
    animation: fade-rise 1.2s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fade-rise {
    to { opacity: 1; transform: translateY(0); }
}

.title-si {
    font-family: 'Noto Serif Sinhala', serif;
    font-size: clamp(2rem, 6vw, 2.5rem);
    font-weight: 700;
    color: var(--saffron-light);
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-shadow: 0 0 40px rgba(200,134,10,0.3);
}

.title-en {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    font-weight: 300;
    font-style: italic;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 14px;
}

/* ── DECORATIVE DIVIDER ── */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto 36px;
    width: fit-content;
    animation: fade-rise 1.4s ease 0.2s forwards;
    opacity: 0;
}

.divider-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--saffron), transparent);
}

.divider-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--saffron);
    box-shadow: 0 0 8px var(--saffron);
}

/* ── CARD ── */
.card {
    background: rgba(253,246,227,0.04);
    border: 1px solid rgba(200,134,10,0.2);
    border-radius: 20px;
    padding: clamp(32px, 5vw, 52px) clamp(28px, 5vw, 52px);
    max-width: 1000px;
    width: 100%;
    backdrop-filter: blur(12px);
    box-shadow:
        0 0 0 1px rgba(200,134,10,0.08),
        0 24px 80px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.05);
    animation: fade-rise 1.4s ease 0.3s forwards;
    opacity: 0;
}

/* ── ABOUT TEXT ── */
.about-label {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--saffron);
    margin-bottom: 14px;
    font-family: 'Cormorant Garamond', serif;
}

.about-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    line-height: 1.85;
    color: rgba(255,255,255,0.72);
    margin-bottom: 20px;
}

.about-text-si {
    font-family: 'Noto Serif Sinhala', serif;
    font-size: clamp(0.88rem, 2vw, 0.98rem);
    line-height: 2;
    color: rgba(255,255,255,0.55);
    margin-bottom: 24px;
}

.about-highlight {
    color: var(--saffron-light);
    font-style: italic;
}

/* Developer credit */
.dev-credit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(200,134,10,0.06);
    border: 1px solid rgba(200,134,10,0.15);
    border-radius: 10px;
    margin-bottom: 28px;
}

.dev-credit-text {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
}

.dev-credit-text strong {
    color: rgba(255,255,255,0.6);
    font-style: normal;
}

/* ── SIGN IN BUTTON ── */
.signin-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--saffron) 0%, var(--maroon) 100%);
    border: none;
    border-radius: 12px;
    font-family: 'Noto Serif Sinhala', 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s;
    box-shadow: 0 4px 20px rgba(123,28,28,0.4);
    position: relative;
    overflow: hidden;
}

.signin-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.2s;
}

.signin-btn:hover::before { opacity: 1; }

.signin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(123,28,28,0.5);
}

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

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

/* ── POPUP OVERLAY ── */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fade-in 0.2s ease;
}

.popup-overlay.active {
    display: flex;
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.popup {
    background: #1E0D03;
    border: 1px solid rgba(200,134,10,0.3);
    border-radius: 20px;
    padding: 40px 36px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0,0,0,0.8);
    animation: popup-rise 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

@keyframes popup-rise {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.3);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s;
}

.popup-close:hover { color: rgba(255,255,255,0.7); }

.popup-wheel {
    font-size: 36px;
    margin-bottom: 16px;
    display: block;
    animation: gentle-spin 20s linear infinite;
}

.popup-title {
    font-family: 'Noto Serif Sinhala', serif;
    font-size: 1.1rem;
    color: var(--saffron-light);
    margin-bottom: 8px;
}

.popup-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.45);
    font-style: italic;
    margin-bottom: 28px;
}

.google-signin-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: #3B2005;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.google-signin-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.popup-note {
    margin-top: 16px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.33);
    font-style: italic;
    font-family: 'Cormorant Garamond', serif;
}

/* ── FOOTER ── */
.landing-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.2);
    font-style: italic;
    animation: fade-rise 1.6s ease 0.6s forwards;
    opacity: 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
    .card { padding: 28px 20px; }
    .popup { padding: 32px 24px; }
}

/* ── AUTHENTICATION FORMS & PAGES ── */
.auth-card {
    text-align: center;
}

.auth-title {
    font-family: 'Noto Serif Sinhala', serif;
    font-size: clamp(1.5rem, 4vw, 1rem);
    color: var(--saffron-light);
    margin-bottom: 8px;
}

.auth-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: rgba(255,255,255,0.5);
    font-style: italic;
    margin-bottom: 24px;
}

/* Standard Auth Form Styling */
.auth-form {
    text-align: left;
    margin-top: 20px;
}

.auth-form p {
    margin-bottom: 16px;
}

.auth-form label {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    color: var(--saffron-pale);
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(200, 134, 10, 0.3);
    border-radius: 10px;
    color: #fff;
    font-family: 'Noto Sans Sinhala', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-form input[type="text"]:focus,
.auth-form input[type="email"]:focus,
.auth-form input[type="password"]:focus {
    outline: none;
    border-color: var(--saffron-light);
    box-shadow: 0 0 12px rgba(200, 134, 10, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.auth-form .helptext, 
.auth-form ul.errorlist {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Cormorant Garamond', serif;
    margin-top: 4px;
    display: block;
}

.auth-form ul.errorlist {
    color: #ff6b6b;
    list-style: none;
    padding: 0;
}

.auth-link {
    color: var(--saffron-light);
    text-decoration: none;
    transition: color 0.2s;
}

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

.divider-text {
    font-family: 'Cormorant Garamond', serif;
    color: rgba(255,255,255,0.3);
    font-size: 0.9rem;
    margin: 24px 0;
    display: flex;
    align-items: center;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200,134,10,0.3), transparent);
}

/* link */

/* --- Elegant Return Home Link --- */
.return-home-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    /* color: var(--text-secondary);
        font-size: 1rem; */
    font-family: 'Cormorant Garamond', 'Noto Serif Sinhala', serif;
    font-weight: 500;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid transparent;
    background: transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.8rem;
    color: var(--brown-light);
}

/* Smooth transition for the arrow span */
.return-home-link span {
    display: inline-block;
    transition: transform 0.2s ease;
}

/* Hover State */
.return-home-link:hover {
    color: var(--maroon);
    background-color: var(--saffron-pale);
    border-color: rgba(200, 134, 10, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(60, 30, 5, 0.05);
}

/* Micro-interaction: Slides the arrow left slightly on hover */
.return-home-link:hover span {
    transform: translateX(-4px);
}

/* Active State (Click) */
.return-home-link:active {
    transform: translateY(0);
    box-shadow: none;
}