/* Anchored: our own styles that Tailwind classes do not cover.
   1. The animated welcome card (home page)
   2. Long text pages (About, Help, Disclaimer, Privacy, Terms) */

/* ---------- 1. Welcome card colors ---------- */
:root {
    --wl-card: linear-gradient(140deg, #1D3FD6 0%, #2F6BF2 50%, #1FB3E6 100%);
    --wl-b1: #5E8BFF; --wl-b2: #4FE0FF; --wl-b3: #6B5CFF; --wl-b4: #9FE7FF;
    --wl-blob-op: .7;
    --wl-line-min: .16; --wl-line-max: .42;
    --wl-border: rgba(255, 255, 255, .35);
    --wl-shadow: 0 24px 46px -22px rgba(31, 79, 209, .65);
    --wl-glass: rgba(255, 255, 255, .16); --wl-glass-line: rgba(255, 255, 255, .45);
    --wl-ring: rgba(255, 255, 255, .6);
    --wl-beam: .30; --wl-beam2: .18; --wl-tower: .75; --wl-sheen: .16;
}
html[data-theme="dark"] {
    --wl-card: linear-gradient(140deg, #071437 0%, #0C2463 50%, #0A3A6B 100%);
    --wl-b1: #2D55E8; --wl-b2: #1BA8D6; --wl-b3: #4A3FD0; --wl-b4: #1580C0;
    --wl-blob-op: .4;
    --wl-line-min: .10; --wl-line-max: .30;
    --wl-border: rgba(255, 255, 255, .10);
    --wl-shadow: 0 24px 50px -24px rgba(0, 0, 0, .8);
    --wl-glass: rgba(255, 255, 255, .08); --wl-glass-line: rgba(255, 255, 255, .22);
    --wl-ring: rgba(255, 255, 255, .35);
    --wl-beam: .22; --wl-beam2: .14; --wl-tower: .55; --wl-sheen: .08;
}
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] {
        --wl-card: linear-gradient(140deg, #071437 0%, #0C2463 50%, #0A3A6B 100%);
        --wl-b1: #2D55E8; --wl-b2: #1BA8D6; --wl-b3: #4A3FD0; --wl-b4: #1580C0;
        --wl-blob-op: .4;
        --wl-line-min: .10; --wl-line-max: .30;
        --wl-border: rgba(255, 255, 255, .10);
        --wl-shadow: 0 24px 50px -24px rgba(0, 0, 0, .8);
        --wl-glass: rgba(255, 255, 255, .08); --wl-glass-line: rgba(255, 255, 255, .22);
        --wl-ring: rgba(255, 255, 255, .35);
        --wl-beam: .22; --wl-beam2: .14; --wl-tower: .55; --wl-sheen: .08;
    }
}

/* ---------- 1. Welcome card layout and motion ---------- */
.wl-hero {
    position: relative; width: 100%; aspect-ratio: 342 / 200; border-radius: 22px; overflow: hidden; isolation: isolate;
    background: var(--wl-card); border: 1px solid var(--wl-border); box-shadow: var(--wl-shadow);
    animation: wlFade 1s cubic-bezier(.2, .7, .2, 1) both;
}
.wl-mesh { position: absolute; inset: 0; filter: blur(34px); z-index: 0; }
.wl-blob { position: absolute; border-radius: 50%; mix-blend-mode: screen; opacity: var(--wl-blob-op); animation: wlFloat ease-in-out infinite alternate; }
.wl-b1 { left: -20%; top: -30%; width: 55%; aspect-ratio: 1; background: var(--wl-b1); animation-duration: 18s; }
.wl-b2 { left: 55%; top: 30%; width: 50%; aspect-ratio: 1; background: var(--wl-b2); animation-duration: 24s; animation-delay: -4s; }
.wl-b3 { left: 10%; top: 55%; width: 44%; aspect-ratio: 1; background: var(--wl-b3); animation-duration: 21s; animation-delay: -8s; }
.wl-b4 { left: 70%; top: -25%; width: 41%; aspect-ratio: 1; background: var(--wl-b4); animation-duration: 27s; animation-delay: -12s; }
@keyframes wlFloat { 0% { transform: translate(0, 0) scale(1); } 33% { transform: translate(12%, 6%) scale(1.15); } 66% { transform: translate(-8%, 9%) scale(.9); } 100% { transform: translate(6%, -6%) scale(1.08); } }
.wl-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; overflow: visible; }
.wl-line { animation: wlDrift linear infinite; }
.wl-rev { animation-direction: reverse; }
@keyframes wlDrift { from { transform: translateX(0); } to { transform: translateX(-200px); } }
.wl-tower { opacity: var(--wl-tower); }
.wl-lamp { filter: drop-shadow(0 0 4px #BFEFFF) drop-shadow(0 0 9px rgba(127, 227, 255, .8)); animation: wlLamp 7s ease-in-out infinite; }
@keyframes wlLamp { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
.wl-beam {
    position: absolute; left: 85.4%; top: 46.5%; width: 220%; aspect-ratio: 1; transform-origin: 0 0; translate: -50% -50%; z-index: 2; pointer-events: none; mix-blend-mode: screen;
    background: conic-gradient(from 0deg, rgba(255,255,255,0) 0deg, rgba(255,255,255,var(--wl-beam)) 9deg, rgba(255,255,255,0) 20deg, rgba(255,255,255,0) 180deg, rgba(255,255,255,var(--wl-beam2)) 189deg, rgba(255,255,255,0) 200deg, rgba(255,255,255,0) 360deg);
    -webkit-mask-image: radial-gradient(circle, #000 0%, rgba(0,0,0,.55) 22%, transparent 58%); mask-image: radial-gradient(circle, #000 0%, rgba(0,0,0,.55) 22%, transparent 58%);
    filter: blur(3px); animation: wlTurn 14s linear infinite;
}
@keyframes wlTurn { from { rotate: 0deg; } to { rotate: 360deg; } }
.wl-beam { transform-origin: center; }
.wl-grain { position: absolute; inset: 0; z-index: 2; opacity: .18; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"); }
.wl-center { position: absolute; left: 50%; top: 44%; width: 0; height: 0; z-index: 3; }
.wl-badge {
    position: absolute; left: -42px; top: -42px; width: 84px; height: 84px; border-radius: 50%;
    background: var(--wl-glass); border: 1px solid var(--wl-glass-line);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 12px 30px -10px rgba(4,16,48,.55);
    display: flex; align-items: center; justify-content: center; animation: wlBreathe 6s ease-in-out infinite;
}
.wl-badge img { position: relative; z-index: 1; width: 56px; height: auto; display: block; filter: drop-shadow(0 2px 6px rgba(0,20,60,.35)); }
.wl-glow { position: absolute; left: 46px; top: 27px; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.95) 0%, rgba(214,230,248,.6) 22%, rgba(150,185,225,.22) 50%, rgba(120,160,210,0) 72%);
    mix-blend-mode: screen; animation: wlOrb 7s ease-in-out infinite; }
.wl-core { position: absolute; left: 46px; top: 27px; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #FFFFFF;
    box-shadow: 0 0 6px 2px rgba(255,255,255,.9), 0 0 14px 4px rgba(191,239,255,.55); animation: wlLamp 7s ease-in-out infinite; }
@keyframes wlOrb { 0%, 100% { transform: scale(.88); opacity: .75; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes wlBreathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.03); } }
.wl-ring { position: absolute; left: -42px; top: -42px; width: 84px; height: 84px; border-radius: 50%; border: 1px solid var(--wl-ring); opacity: 0;
    animation: wlRipple 6s cubic-bezier(.2,.6,.3,1) infinite; }
@keyframes wlRipple { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3.2); opacity: 0; } }
.wl-sheen { position: absolute; inset: 0; z-index: 4; transform: translateX(-100%);
    background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,var(--wl-sheen)) 48%, transparent 60%);
    animation: wlSheen 9s ease-in-out 1.2s infinite; }
@keyframes wlSheen { 0% { transform: translateX(-100%); } 35%, 100% { transform: translateX(100%); } }
.wl-chip { position: absolute; left: 14px; bottom: 14px; z-index: 5; display: flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px;
    background: var(--wl-glass); border: 1px solid var(--wl-glass-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: #FFFFFF; }
.wl-dot { width: 6px; height: 6px; border-radius: 50%; background: #7FE3FF; animation: wlPulse 2.4s ease-out infinite; }
@keyframes wlPulse { 0% { box-shadow: 0 0 0 0 rgba(127,227,255,.7); } 100% { box-shadow: 0 0 0 7px rgba(127,227,255,0); } }
@keyframes wlFade { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.wl-rise > * { animation: wlUp .7s cubic-bezier(.2,.7,.2,1) both; }
.wl-rise > :nth-child(1) { animation-delay: .15s; } .wl-rise > :nth-child(2) { animation-delay: .25s; }
.wl-rise > :nth-child(3) { animation-delay: .35s; } .wl-rise > :nth-child(4) { animation-delay: .45s; }
.wl-rise > :nth-child(n+5) { animation-delay: .55s; }
@keyframes wlUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Members who turn on Reduce Motion get a still picture */
@media (prefers-reduced-motion: reduce) {
    .wl-hero, .wl-hero *, .wl-rise > * { animation: none !important; }
    .wl-ring, .wl-sheen { display: none; }
}

/* ---------- 2. Long text pages ---------- */
.legal h2 { font-family: "Lora", serif; font-size: 1.35rem; font-weight: 600; margin: 2rem 0 .75rem; }
.legal h3 { font-weight: 600; font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
.legal p { margin: .75rem 0; line-height: 1.7; color: var(--color-muted); }
.legal strong { color: var(--color-ink); }
.legal ul { list-style: disc; padding-left: 1.5rem; margin: .75rem 0; color: var(--color-muted); }
.legal li { margin: .35rem 0; line-height: 1.6; }
.legal a { color: var(--color-accent); text-decoration: underline; }
.legal-alert { border-left: 4px solid #D64545; background: rgba(214, 69, 69, .10); border-radius: 6px; padding: .5rem 1rem; margin: 1rem 0; }
.legal-note { border-left: 4px solid var(--color-accent); background: var(--color-soft); border-radius: 6px; padding: .5rem 1rem; margin: 1rem 0; }
.legal-alert p, .legal-note p { color: var(--color-ink); }

/* ---------- 3. Form error messages ---------- */
.form-error { color: #B42318; }
html[data-theme="dark"] .form-error { color: #FF9B8F; }
@media (prefers-color-scheme: dark) { html[data-theme="system"] .form-error { color: #FF9B8F; } }
.form-error-box { background: rgba(214, 69, 69, .12); }
