/* ==========================================================================
   ChatViro — Log in / Sign up screens (account.html, #unauthenticated-view)
   Look only: colour grading, glow, shadows, motion. Layout and markup unchanged.
   Everything is scoped to #unauthenticated-view so the rest of the app is untouched.
   ========================================================================== */

#unauthenticated-view {
    --cv-g1: #10b981;   /* emerald */
    --cv-g2: #06b6d4;   /* cyan    */
    --cv-g3: #6366f1;   /* indigo  */
    --cv-g4: #a855f7;   /* violet  */
    --cv-ink: #0f172a;
    position: relative;
    isolation: isolate;
}

/* Soft aurora behind the cards */
#unauthenticated-view::before,
#unauthenticated-view::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .85;
    animation: cvAuroraFloat 14s ease-in-out infinite alternate;
}
#unauthenticated-view::before {
    width: 420px; height: 420px;
    top: -40px; left: -12%;
    background: radial-gradient(circle at 30% 30%, rgba(16,185,129,.55), rgba(6,182,212,.25) 55%, transparent 72%);
}
#unauthenticated-view::after {
    width: 460px; height: 460px;
    top: 120px; right: -14%;
    background: radial-gradient(circle at 60% 40%, rgba(99,102,241,.45), rgba(168,85,247,.22) 55%, transparent 72%);
    animation-delay: -7s;
}
@keyframes cvAuroraFloat {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(24px, 30px, 0) scale(1.08); }
}

/* ---------- Cards: gradient border, layered coloured shadow, top light strip ---------- */
#auth-selector-screen,
#login-card,
#signup-selection-card,
#meta-signup-options-card,
#signup-card {
    position: relative;
    border: 2px solid transparent !important;
    background:
        radial-gradient(120% 60% at 50% 0%, rgba(236,253,245,.9), rgba(255,255,255,0) 60%) padding-box,
        linear-gradient(180deg, #ffffff, #ffffff) padding-box,
        linear-gradient(135deg, var(--cv-g1), var(--cv-g2) 35%, var(--cv-g3) 70%, var(--cv-g4)) border-box !important;
    background-size: 100% 100%, 100% 100%, 220% 220% !important;
    box-shadow:
        0 1px 0 rgba(255,255,255,.9) inset,
        0 18px 40px -18px rgba(15,23,42,.25),
        0 30px 70px -30px rgba(16,185,129,.45),
        0 30px 80px -40px rgba(99,102,241,.45) !important;
    border-radius: 22px !important;
    animation: cvBorderFlow 9s ease-in-out infinite;
    transition: box-shadow .35s ease, transform .35s ease !important;
    overflow: hidden;
}
#auth-selector-screen:hover,
#login-card:hover,
#signup-selection-card:hover,
#meta-signup-options-card:hover,
#signup-card:hover {
    box-shadow:
        0 1px 0 rgba(255,255,255,.9) inset,
        0 22px 50px -18px rgba(15,23,42,.28),
        0 36px 90px -28px rgba(16,185,129,.6),
        0 36px 100px -36px rgba(99,102,241,.6) !important;
}
/* the long sign-up form should not zoom on hover (it is hard to fill a moving form) */
#signup-card:hover { transform: none !important; }

#auth-selector-screen::before,
#login-card::before,
#signup-selection-card::before,
#meta-signup-options-card::before,
#signup-card::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--cv-g1), var(--cv-g2), var(--cv-g3), var(--cv-g4), var(--cv-g1));
    background-size: 200% 100%;
    animation: cvStripFlow 6s linear infinite;
}
@keyframes cvBorderFlow {
    0%, 100% { background-position: 0 0, 0 0, 0% 50%; }
    50%      { background-position: 0 0, 0 0, 100% 50%; }
}
@keyframes cvStripFlow {
    from { background-position: 0% 0; }
    to   { background-position: 200% 0; }
}

/* ---------- Logo: halo + gentle float ---------- */
#auth-selector-screen img[alt="ChatViro Logo"] {
    filter: drop-shadow(0 10px 22px rgba(37,99,235,.45)) drop-shadow(0 0 18px rgba(16,185,129,.35));
    animation: cvLogoFloat 4.5s ease-in-out infinite;
}
@keyframes cvLogoFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* ---------- Titles: gradient ink ---------- */
#unauthenticated-view h2,
#auth-selector-screen h1,
#auth-selector-screen h2,
#auth-selector-screen h3 {
    background: linear-gradient(90deg, #0f172a 0%, #1e3a8a 45%, #047857 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    letter-spacing: -.01em;
}

/* ---------- Header icon tiles (lock, user-plus …) ---------- */
#unauthenticated-view .w-9.h-9.rounded-lg {
    background: linear-gradient(135deg, var(--cv-g1), var(--cv-g3)) !important;
    color: #fff !important;
    box-shadow: 0 8px 20px -6px rgba(16,185,129,.55), 0 0 0 4px rgba(99,102,241,.08) !important;
    border-radius: 12px !important;
}

/* ---------- Choice buttons (Log in / Sign up / Meta / Legacy) ---------- */
#auth-selector-screen button.bg-blue-50,
#signup-selection-card button.bg-blue-50,
#meta-signup-options-card button.bg-blue-50,
#login-card button[type="submit"] {
    position: relative;
    overflow: hidden;
    border: 1.5px solid transparent !important;
    background:
        linear-gradient(180deg, #f8fbff, #eef6ff) padding-box,
        linear-gradient(135deg, rgba(16,185,129,.55), rgba(99,102,241,.55)) border-box !important;
    color: #1d4ed8 !important;
    box-shadow: 0 6px 16px -10px rgba(37,99,235,.45) !important;
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease !important;
}
#auth-selector-screen button.bg-blue-50:hover,
#signup-selection-card button.bg-blue-50:hover,
#meta-signup-options-card button.bg-blue-50:hover {
    transform: translateY(-2px);
    background:
        linear-gradient(180deg, #ffffff, #f0fdf9) padding-box,
        linear-gradient(135deg, var(--cv-g1), var(--cv-g3)) border-box !important;
    box-shadow: 0 14px 28px -12px rgba(16,185,129,.55), 0 10px 26px -14px rgba(99,102,241,.55) !important;
    color: #047857 !important;
}

/* Main action buttons: Log in, Connect account (and the first choice on the welcome card) */
#auth-selector-screen button.bg-blue-50:first-child,
#login-card button[type="submit"],
#signup-card #submit-btn {
    background: linear-gradient(135deg, #059669 0%, #10b981 40%, #06b6d4 100%) !important;
    color: #fff !important;
    border: 0 !important;
    letter-spacing: .02em;
    box-shadow:
        0 10px 24px -10px rgba(5,150,105,.75),
        0 0 0 1px rgba(255,255,255,.25) inset,
        0 0 26px -6px rgba(6,182,212,.55) !important;
    position: relative;
    overflow: hidden;
}
#login-card button[type="submit"] i,
#login-card button[type="submit"] svg,
#auth-selector-screen button.bg-blue-50:first-child i,
#auth-selector-screen button.bg-blue-50:first-child svg { color: #fff !important; }
#auth-selector-screen button.bg-blue-50:first-child:hover { color: #fff !important; }
#auth-selector-screen button.bg-blue-50:first-child:hover,
#login-card button[type="submit"]:hover,
#signup-card #submit-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 16px 32px -12px rgba(5,150,105,.85),
        0 0 0 1px rgba(255,255,255,.35) inset,
        0 0 36px -4px rgba(6,182,212,.7) !important;
}
#login-card button[type="submit"]:active,
#signup-card #submit-btn:active { transform: translateY(0); }
/* light sweep across the main buttons on hover */
#auth-selector-screen button.bg-blue-50:first-child::after,
#login-card button[type="submit"]::after,
#signup-card #submit-btn::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0; left: -60%;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
    transform: skewX(-18deg);
    transition: left .6s ease;
}
#auth-selector-screen button.bg-blue-50:first-child:hover::after,
#login-card button[type="submit"]:hover::after,
#signup-card #submit-btn:hover::after { left: 120%; }
#signup-card #submit-btn { padding-left: 1.75rem !important; padding-right: 1.75rem !important; }

/* ---------- Inner sections of the sign-up form (credentials / connection settings) ---------- */
#signup-card .rounded-2xl,
#signup-card .rounded-xl.border-2,
#signup-card [class*="bg-blue-50/"],
#signup-card [class*="bg-emerald-50/"] {
    box-shadow: 0 10px 30px -22px rgba(15,23,42,.35), inset 0 1px 0 rgba(255,255,255,.9);
}
#signup-card [class*="border-blue-1"],
#signup-card [class*="border-blue-2"] {
    background-image: linear-gradient(160deg, rgba(239,246,255,.95), rgba(238,242,255,.7) 60%, rgba(255,255,255,.9)) !important;
}
#signup-card [class*="border-emerald-1"]:not(input):not(select):not(textarea):not(button),
#signup-card [class*="border-emerald-2"]:not(input):not(select):not(textarea):not(button) {
    background-image: linear-gradient(160deg, rgba(236,253,245,.95), rgba(240,253,250,.7) 60%, rgba(255,255,255,.9));
}

/* ---------- Inputs, selects, text areas ---------- */
#unauthenticated-view input:not([type="checkbox"]):not([type="radio"]),
#unauthenticated-view select,
#unauthenticated-view textarea,
#unauthenticated-view #country-select-btn {
    background: linear-gradient(180deg, #ffffff, #fbfdff) !important;
    border-color: rgba(148,163,184,.45) !important;
    box-shadow: 0 1px 2px rgba(15,23,42,.05), inset 0 1px 0 rgba(255,255,255,.8) !important;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease !important;
}
#unauthenticated-view input:not([type="checkbox"]):not([type="radio"]):hover,
#unauthenticated-view select:hover,
#unauthenticated-view textarea:hover,
#unauthenticated-view #country-select-btn:hover {
    border-color: rgba(16,185,129,.55) !important;
}
#unauthenticated-view input:not([type="checkbox"]):not([type="radio"]):focus,
#unauthenticated-view select:focus,
#unauthenticated-view textarea:focus,
#unauthenticated-view #country-select-btn:focus {
    outline: none !important;
    border-color: var(--cv-g1) !important;
    background: #fff !important;
    box-shadow:
        0 0 0 4px rgba(16,185,129,.16),
        0 0 22px -4px rgba(6,182,212,.45),
        0 2px 6px rgba(15,23,42,.06) !important;
}
/* keep the red error state visible */
#unauthenticated-view input.border-rose-500,
#unauthenticated-view textarea.border-rose-500 {
    border-color: #f43f5e !important;
    box-shadow: 0 0 0 4px rgba(244,63,94,.14), 0 0 18px -6px rgba(244,63,94,.5) !important;
}

/* labels a touch stronger, section titles with a glow dot */
#unauthenticated-view label.text-slate-500 { color: #475569 !important; }
#signup-card h3,
#signup-card .uppercase.tracking-wider,
#signup-card .uppercase.tracking-wide {
    text-shadow: 0 0 18px rgba(16,185,129,.25);
}

/* links ("Log In", "Sign Up") */
#unauthenticated-view .underline.decoration-dotted {
    background: linear-gradient(90deg, #2563eb, #059669);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    text-decoration-color: rgba(37,99,235,.5) !important;
}

/* close / back buttons */
#unauthenticated-view button[title^="Back to"] {
    border-radius: 10px !important;
    transition: background .2s ease, color .2s ease, transform .2s ease !important;
}
#unauthenticated-view button[title^="Back to"]:hover {
    background: rgba(244,63,94,.08) !important;
    color: #e11d48 !important;
    transform: rotate(90deg);
}

/* ---------- Motion off for people who prefer less movement ---------- */
@media (prefers-reduced-motion: reduce) {
    #unauthenticated-view::before,
    #unauthenticated-view::after,
    #auth-selector-screen, #login-card, #signup-selection-card, #meta-signup-options-card, #signup-card,
    #auth-selector-screen::before, #login-card::before, #signup-selection-card::before,
    #meta-signup-options-card::before, #signup-card::before,
    #auth-selector-screen img[alt="ChatViro Logo"] {
        animation: none !important;
    }
}

/* small screens: smaller aurora so nothing spills sideways */
@media (max-width: 640px) {
    #unauthenticated-view::before { width: 260px; height: 260px; left: -20%; }
    #unauthenticated-view::after  { width: 280px; height: 280px; right: -20%; }
}

/* the glow may reach past the screen edge: never let it create a sideways scroll */
html:has(#unauthenticated-view:not(.hidden)),
body:has(#unauthenticated-view:not(.hidden)) {
    overflow-x: clip;
}
