/* e661e.io — shared design system ("the glowing lab").
   One visual language across www.e661e.io, auth.e661e.io and
   auth.lab.e661e.io (the Authentik brand CSS mirrors these tokens).
   Inspiration: logo.png — a 3D isometric neon server monolith.
   Deep-space navy, glass panels, green/cyan circuit glow. */

:root {
    color-scheme: dark;

    /* palette */
    --bg-0: #030609;            /* page base — near-black navy */
    --bg-1: #071019;            /* raised background */
    --surface: rgba(13, 23, 38, 0.55);      /* glass panel */
    --surface-solid: #0b1420;   /* opaque fallback / inputs */
    --border: rgba(25, 214, 154, 0.20);
    --border-dim: rgba(148, 199, 255, 0.08);
    --border-strong: rgba(25, 214, 154, 0.42);

    --text: #e9f2f7;
    --muted: #9ab0c2;           /* AA-legible on the glass panels */
    --faint: #6d8196;           /* AA floor even for the quietest copy */

    --accent: #19d69a;          /* deep emerald */
    --accent-2: #3ad2ff;        /* hologram cyan */
    --accent-dim: rgba(25, 214, 154, 0.1);
    --accent-grad: linear-gradient(135deg, #19d69a 0%, #3ad2ff 100%);
    --danger: #ff5d55;

    --glow-sm: 0 0 12px rgba(25, 214, 154, 0.25);
    --glow-md: 0 0 28px rgba(25, 214, 154, 0.28);
    --glow-cyan: 0 0 24px rgba(58, 210, 255, 0.22);

    /* gloss kit — the reglaze. A bright top edge, a soft top sheen, and a low
       emerald halo give panels and buttons depth instead of a flat fill. */
    --edge-top: rgba(180, 245, 220, 0.5);   /* bright specular top hairline */
    --sheen: rgba(233, 242, 247, 0.05);     /* faint top-of-panel light wash */
    --halo: rgba(25, 214, 154, 0.24);       /* ambient emerald glow beneath */

    --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --radius: 14px;
    --radius-sm: 8px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 4.5rem;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-0);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    /* faint circuit-grid over a deep radial wash — the whole site sits on it */
    background-image:
        radial-gradient(ellipse 80% 60% at 50% -20%, rgba(25, 214, 154, 0.06), transparent),
        radial-gradient(ellipse 60% 50% at 85% 110%, rgba(58, 210, 255, 0.05), transparent),
        linear-gradient(rgba(84, 110, 140, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(84, 110, 140, 0.07) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 44px 44px, 44px 44px;
    background-attachment: fixed;
}

::selection {
    background: var(--accent);
    color: var(--bg-0);
}

a {
    color: var(--accent);
}

/* ---------- Type helpers ---------- */

h1, h2, h3 {
    font-family: var(--font-display);
}

.grad-text {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.mono-kicker {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: lowercase;
}

/* ---------- Brand lockup ----------
   Inline geometric mark + Space Grotesk wordmark; replaces the old
   raster logo on every page (the raster stays for external hotlinks).
   Text is real HTML so the webfont applies — an <img src="*.svg">
   cannot load external fonts. */

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.brand-mark {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 7px rgba(25, 214, 154, 0.3));
    transition: filter 0.3s ease;
}

.brand-word {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.55rem;
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--text);
    text-shadow: 0 0 16px rgba(25, 214, 154, 0.16);
    transition: text-shadow 0.3s ease;
}

.brand-tld {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-link:hover .brand-mark,
.brand-link:focus-visible .brand-mark {
    filter: drop-shadow(0 0 13px rgba(25, 214, 154, 0.6));
}

.brand-link:hover .brand-word,
.brand-link:focus-visible .brand-word {
    text-shadow: 0 0 20px rgba(25, 214, 154, 0.38);
}

/* ---------- Glass panel ---------- */

.glass {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow:
        inset 0 1px 0 rgba(233, 242, 247, 0.05),
        0 12px 40px rgba(0, 0, 0, 0.45);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.98rem;
    font-weight: 600;
    font-family: var(--font-display);
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.25s ease,
                background 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    border: none;
}

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

.btn-primary {
    background: var(--accent-grad);
    color: #04140c;             /* dark ink on the gradient — never white-on-green */
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),   /* top gloss highlight */
        var(--glow-sm),
        0 8px 22px -10px var(--halo);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        var(--glow-md),
        0 10px 26px rgba(0, 0, 0, 0.4);
}

.btn-secondary {
    background: rgba(25, 214, 154, 0.04);
    border: 1px solid var(--border-strong);
    color: var(--accent);
}

.btn-secondary:hover {
    background: var(--accent-dim);
    box-shadow: var(--glow-sm);
    transform: translateY(-2px);
}

.btn-oauth {
    background: var(--surface-solid);
    border: 1px solid var(--border-dim);
    color: var(--text);
    width: 100%;
}

.btn-oauth:hover {
    border-color: var(--border-strong);
    box-shadow: var(--glow-sm);
    transform: translateY(-1px);
}

.btn-google:hover { border-color: #4285F4; box-shadow: 0 0 16px rgba(66, 133, 244, 0.25); }
.btn-github:hover { border-color: var(--muted); }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #e0463e;
    box-shadow: 0 0 18px rgba(255, 93, 85, 0.35);
}

.btn-full {
    width: 100%;
}

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

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ---------- Forms ---------- */

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-display);
    color: var(--text);
    margin-bottom: 0.45rem;
    letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(3, 6, 9, 0.7);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(25, 214, 154, 0.12), var(--glow-sm);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--faint);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ---------- Divider ---------- */

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(25, 214, 154, 0.25), transparent);
}

.divider span {
    padding: 0 1rem;
    color: var(--muted);
    font-size: 0.875rem;
    font-family: var(--font-mono);
}

/* ---------- Status dot ---------- */

.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 0.5rem;
    box-shadow: 0 0 10px rgba(25, 214, 154, 0.8);
    animation: pulse-dot 2.6s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 6px rgba(25, 214, 154, 0.5); }
    50% { box-shadow: 0 0 14px rgba(25, 214, 154, 0.95); }
}

/* ---------- Footer ---------- */

footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--border-dim);
}

footer p {
    color: var(--muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.copyright {
    font-size: 0.75rem;
    color: var(--faint);
    font-family: var(--font-mono);
}

/* ---------- Scroll reveal (site.js toggles .revealed) ----------
   Hidden state only applies under .js-reveal, which site.js stamps on
   <html> before observing — with JS disabled or failed, content stays
   visible (no invisible auth card on a static page). */

.js-reveal .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-reveal .reveal.revealed {
    opacity: 1;
    transform: none;
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
