/* Palette from the Lariq Logic artwork: deep space black, violet, indigo, teal and silver. */
:root {
    --bg: #000000;
    --violet: #a855f7;
    --violet-soft: #c4b5fd;
    --indigo: #6366f1;
    --teal: #2dd4bf;
    --cyan: #22d3ee;
    --silver: #e2e8f0;
    --text: #ede9fe;
    --text-muted: #a5a3c9;
    --glow: rgba(168, 85, 247, 0.4);
    --line: rgba(196, 181, 253, 0.28);
    --panel: rgba(12, 8, 28, 0.82);
    --field: rgba(255, 255, 255, 0.05);
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #4f46e5 50%, #0d9488 100%);
    --radius: 16px;
}

/* Orbitron (SIL Open Font License, see /fonts/OFL-Orbitron.txt) */
@font-face {
    font-family: "Orbitron";
    src: url("/fonts/orbitron-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 16px;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    overflow-x: hidden;
}

/* Background canvas (js/vortex.js) */
.sky {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Tagline sits low on the screen, leaving the middle of the sky for the voyage. */
.coming-soon {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: max(13vh, 104px);
    z-index: 2;
    text-align: center;
    pointer-events: none;
}

/* Read by screen readers and search engines, not shown on screen. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.coming-soon-text {
    margin: 0;
    font-family: "Orbitron", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    font-size: clamp(0.85rem, 3.1vw, 1.5rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #ffffff;
    text-shadow: 0 0 14px rgba(168, 85, 247, 0.55), 0 0 3px #000, 0 0 8px #000;
}

.coming-soon-text::before {
    content: "> ";
    color: var(--violet);
}

/* Floppy disk login button */
.floppy-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 3;
    display: block;
    width: 64px;
    height: 64px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.55)) drop-shadow(0 0 18px rgba(244, 114, 182, 0.3));
    transition: filter 0.2s, transform 0.2s;
}

.floppy-btn svg {
    display: block;
    width: 100%;
    height: 100%;
}

.floppy-btn:hover {
    filter: drop-shadow(0 0 14px rgba(45, 212, 191, 0.75)) drop-shadow(0 0 24px rgba(244, 114, 182, 0.55));
    animation: floppy-wiggle 0.6s ease-in-out;
}

.floppy-btn:active {
    transform: scale(0.94);
}

@keyframes floppy-wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-8deg) scale(1.06); }
    50% { transform: rotate(6deg) scale(1.06); }
    75% { transform: rotate(-3deg) scale(1.03); }
}

.floppy-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* Login card */
.login-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 380px;
    padding: 36px 32px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 0 48px rgba(124, 58, 237, 0.3), inset 0 0 24px rgba(99, 102, 241, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.portal-title {
    margin: 0 0 28px;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--violet-soft);
    text-shadow: 0 0 14px var(--glow);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 12px 14px;
    font: inherit;
    color: var(--text);
    background: var(--field);
    border: 1px solid rgba(196, 181, 253, 0.2);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
}

.form-utilities {
    display: flex;
    justify-content: flex-end;
    margin-top: -6px;
}

.forgot-password-link {
    padding: 0;
    font: inherit;
    font-size: 0.85rem;
    color: var(--teal);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.forgot-password-link:hover,
.forgot-password-link:focus-visible {
    text-decoration: underline;
}

.login-btn {
    margin-top: 6px;
    padding: 12px;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #ffffff;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 18px var(--glow);
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}

.login-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 28px rgba(168, 85, 247, 0.6);
}

.login-btn:active {
    transform: translateY(1px);
}

.login-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.login-btn[disabled] {
    opacity: 0.6;
    cursor: progress;
}

.form-status {
    margin: 0;
    padding: 10px 12px;
    font-size: 0.875rem;
    text-align: center;
    color: var(--text);
    background: rgba(124, 58, 237, 0.14);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.form-status[hidden] {
    display: none;
}

/* Login pop-up */
.login-dialog {
    width: calc(100% - 32px);
    max-width: 380px;
    padding: 0;
    color: var(--text);
    background: transparent;
    border: none;
    overflow: visible;
}

.login-dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.dialog-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.dialog-close:hover,
.dialog-close:focus-visible {
    color: var(--violet-soft);
}

@media (max-width: 420px) {
    .login-container {
        padding: 28px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .floppy-btn:hover {
        animation: none;
    }

    .floppy-btn,
    .input-group input,
    .login-btn {
        transition: none;
    }
}

/* 404 page */
.not-found {
    position: relative;
    z-index: 2;
    max-width: 520px;
    text-align: center;
}

.not-found-floppy {
    display: block;
    margin: 0 auto 18px;
    filter: drop-shadow(0 0 14px rgba(59, 130, 246, 0.6)) drop-shadow(0 0 22px rgba(244, 114, 182, 0.35));
    transform: rotate(-8deg);
}

.not-found-code {
    margin: 0;
    font-family: "Orbitron", "Segoe UI", Arial, sans-serif;
    font-size: clamp(3.5rem, 14vw, 6rem);
    font-weight: 700;
    line-height: 1;
    color: var(--violet-soft);
    text-shadow: 0 0 24px var(--glow);
}

.not-found-title {
    margin: 14px 0 8px;
    font-family: "Orbitron", "Segoe UI", Arial, sans-serif;
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    color: #ffffff;
}

.not-found-text {
    margin: 0 0 24px;
    color: var(--text-muted);
}

.not-found-link {
    display: inline-block;
    padding: 12px 22px;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    background: var(--accent-gradient);
    border-radius: 12px;
    box-shadow: 0 0 18px var(--glow);
}

.not-found-link:hover,
.not-found-link:focus-visible {
    filter: brightness(1.1);
}

/* Privacy, terms and contact pages */
body.legal-page {
    display: block;
    place-items: normal;
    padding: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(124, 58, 237, 0.25), transparent 55%),
        radial-gradient(ellipse at 90% 10%, rgba(45, 212, 191, 0.12), transparent 50%),
        var(--bg);
}

.legal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 820px;
    margin: 0 auto;
    padding: 20px 16px;
}

.legal-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: "Orbitron", "Segoe UI", Arial, sans-serif;
    font-weight: 700;
    color: var(--violet-soft);
    text-decoration: none;
}

.legal-brand img {
    filter: drop-shadow(0 0 8px var(--glow));
}

.legal {
    width: min(820px, calc(100% - 32px));
    margin: 0 auto 40px;
    padding: 32px 28px;
    line-height: 1.65;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.legal h1 {
    margin: 0 0 6px;
    font-family: "Orbitron", "Segoe UI", Arial, sans-serif;
    font-size: clamp(1.5rem, 5vw, 2.1rem);
    color: #ffffff;
}

.legal h2 {
    margin: 32px 0 8px;
    font-family: "Orbitron", "Segoe UI", Arial, sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    color: var(--violet-soft);
}

.legal p,
.legal li {
    color: var(--text);
}

.legal ul {
    padding-left: 22px;
}

.legal li + li {
    margin-top: 6px;
}

.legal a {
    color: var(--teal);
    text-underline-offset: 3px;
}

.legal-updated {
    margin: 0 0 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.legal-lead {
    font-size: 1.05rem;
}

.legal table {
    width: 100%;
    margin: 12px 0;
    border-collapse: collapse;
    font-size: 0.93rem;
}

.legal th,
.legal td {
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

.legal th {
    color: var(--violet-soft);
    font-weight: 700;
}

.legal-table-wrap {
    overflow-x: auto;
}

.legal .contact-card {
    display: inline-block;
    margin: 6px 0 4px;
    padding: 14px 20px;
    font-family: "Orbitron", "Segoe UI", Arial, sans-serif;
    font-size: clamp(1rem, 4vw, 1.25rem);
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    background: var(--accent-gradient);
    border-radius: 14px;
    box-shadow: 0 0 18px var(--glow);
    word-break: break-all;
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
}

.site-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.site-footer-links a:hover,
.site-footer-links a:focus-visible {
    color: var(--violet-soft);
    text-decoration: underline;
}

.legal-footer {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 16px 40px;
    text-align: center;
}

/* Footer links on the home page: bottom-left, clear of the floppy button. */
.home-footer {
    position: fixed;
    left: 16px;
    bottom: 22px;
    z-index: 3;
}

.home-footer .site-footer-links {
    justify-content: flex-start;
}

@media (max-width: 520px) {
    .legal {
        padding: 24px 18px;
        border-radius: 12px;
    }

    .home-footer {
        right: 96px;
    }
}
