/*
 * Site brand visual design, ported from a Figma Make prototype
 * ("E-commerce website design"). Palette: warm-white paper + near-black
 * ink + a single vivid-red accent; Russo One for display type, Inter for
 * body copy (both Cyrillic-ready). Comic/print accents (halftone dots,
 * sticker badges) are used sparingly, matching the source design.
 */

:root {
    --ink: #0D0C0A;
    --paper: #F8F5F0;
    --line: #E2DDD5;
    --muted: #7A726A;
    --accent: #FF1F4B;
    --accent-dark: #CC1238;
    --surface: #FFFFFF;
    --surface-2: #F2EDE5;

    --font-display: 'Russo One', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-full: 999px;

    --shadow-card: 0 8px 32px rgba(13, 12, 10, 0.10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Russo One ships one weight — never let the browser fake a bolder
       one, it smears the outlines and closes up Cyrillic counters. */
    font-synthesis-weight: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    cursor: pointer;
}

/* <picture> only wraps the <img>; keeping it out of the box tree means every
   existing rule that sizes the image against its real container still applies. */
picture {
    display: contents;
}

/* ── Comic/print accents ──────────────────────────────────────── */

/* Halftone dot pattern — used sparingly as a section background accent */
.halftone-bg {
    background-image: radial-gradient(circle, rgba(13, 12, 10, 0.065) 1.1px, transparent 1.1px);
    background-size: 9px 9px;
}

/* Sticker badge shape — slight rotation + asymmetric radius */
.badge-sticker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px 6px 2px 6px;
    transform: rotate(-1.8deg);
    font-family: var(--font-display);
    letter-spacing: 0.03em;
}

/* Thin ruled accent line under a section heading */
.rule-accent::after {
    content: '';
    display: block;
    width: 3rem;
    height: 3px;
    margin-top: 0.5rem;
    border-radius: 2px;
    background-color: var(--accent);
}

/* ── Header ────────────────────────────────────────────────────── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
}

.site-header__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-header__brand {
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    gap: 0;
}

.site-header__logo {
    max-height: 32px;
    display: block;
}

.site-header__wordmark {
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 1;
    color: var(--ink);
}

/* Second colour of the text wordmark, e.g. "Art" in "FanArt". */
.site-header__wordmark--accent {
    color: var(--accent);
}

.site-header__badge {
    margin-left: 0.25rem;
    margin-bottom: 0.125rem;
    align-self: flex-end;
    background: var(--ink);
    color: var(--paper);
    font-size: 8px;
    font-weight: 400;
    padding: 0.125rem 0.375rem;
}

/* Nav */
.site-nav {
    margin-left: 0.5rem;
}

.site-nav__list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.125rem;
    margin: 0;
    padding: 0;
}

.site-nav__link {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(13, 12, 10, 0.65);
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav__link:hover {
    color: var(--ink);
    background: var(--paper);
    text-decoration: none;
}

.site-nav__link--active {
    color: var(--ink);
    font-weight: 600;
}

/* Search */
.site-header__search {
    flex: 1;
    max-width: 280px;
    margin-left: auto;
}

.site-header__search-field {
    position: relative;
    width: 100%;
}

.site-header__search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--ink);
}

.site-header__search-input::placeholder {
    color: var(--muted);
}

.site-header__search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 31, 75, 0.15);
}

.site-header__search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--muted);
    pointer-events: none;
}

/* Right-side icon cluster */
.site-header__actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.75rem;
}

.site-header__icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    /* Reset the button chrome — this class sits on <button> as often as on
       <a>, and a browser's own border/background made those two read as
       different controls in the same row. */
    background: none;
    border: none;
    border-radius: var(--radius-xl);
    color: rgba(13, 12, 10, 0.6);
    transition: color 0.15s ease, background-color 0.15s ease;
}

.site-header__icon-btn:hover {
    color: var(--ink);
    background: var(--paper);
}

.site-header__icon-btn svg {
    width: 20px;
    height: 20px;
}

/* Replaces the plain account icon once logged in — header icon-button and
   mobile drawer both reuse it, sized by their own container/gap rules. */
.site-header__account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--ink);
    color: var(--paper);
    font-size: 10px;
    font-weight: 700;
}

.site-header__hamburger {
    display: none;
}

.site-header__drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(13, 12, 10, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.site-header__drawer-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.site-header__drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    width: 300px;
    max-width: 85vw;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    box-shadow: -8px 0 32px rgba(13, 12, 10, 0.18);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.site-header__drawer.is-open {
    transform: translateX(0);
}

.site-header__drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--line);
}

.site-header__drawer-brand {
    display: flex;
    align-items: flex-end;
}

.site-header__drawer-search {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line);
}

.site-header__drawer-nav {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.75rem;
}

.site-header__drawer-nav .site-nav__link {
    text-align: left;
    padding: 0.75rem;
    color: var(--ink);
}

.site-header__drawer-foot {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--line);
}

.site-header__drawer-account {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(13, 12, 10, 0.7);
    background: none;
    border: none;
}

.site-header__drawer-account svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 1023px) {
    .site-nav,
    .site-header__search,
    .site-header__icon-btn--account {
        display: none;
    }

    .site-header__hamburger {
        display: inline-flex;
    }
}

@media (min-width: 1024px) {
    .site-header__drawer,
    .site-header__drawer-backdrop {
        display: none;
    }
}

/* ── Hero (homepage only) ─────────────────────────────────────── */

.hero {
    position: relative;
    overflow: hidden;
    background: var(--ink);
    min-height: min(70vh, 600px);
    display: flex;
    align-items: center;
}

.hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
}

.hero__halftone {
    position: absolute;
    inset: 0;
    opacity: 0.3;
}

.hero__gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(13, 12, 10, 0.9), rgba(13, 12, 10, 0.6), rgba(13, 12, 10, 0.4));
}

@media (min-width: 768px) {
    .hero__gradient {
        background: linear-gradient(to right, rgba(13, 12, 10, 0.9), rgba(13, 12, 10, 0.5) 55%, transparent);
    }
}

.hero__inner {
    position: relative;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 3.5rem 1rem;
}

@media (min-width: 640px) {
    .hero__inner {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

@media (min-width: 1024px) {
    .hero__inner {
        padding-top: 8rem;
        padding-bottom: 8rem;
    }
}

.hero__badge {
    display: inline-flex;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .hero__badge {
        margin-bottom: 1.25rem;
    }
}

.hero__heading {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--paper);
    line-height: 1.05;
    font-size: clamp(1.9rem, 6vw, 5.5rem);
    margin: 0 0 0.75rem;
}

@media (min-width: 768px) {
    .hero__heading {
        margin-bottom: 1rem;
    }
}

.hero__heading-accent {
    color: var(--accent);
}

.hero__subtitle {
    color: rgba(248, 245, 240, 0.65);
    font-size: 0.875rem;
    line-height: 1.6;
    max-width: 24rem;
    margin: 0 0 1.5rem;
}

@media (min-width: 640px) {
    .hero__subtitle {
        font-size: 1rem;
        max-width: 28rem;
    }
}

@media (min-width: 768px) {
    .hero__subtitle {
        font-size: 1.0625rem;
        max-width: 32rem;
        margin-bottom: 2rem;
    }
}

.hero__ctas {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    width: 100%;
}

@media (min-width: 640px) {
    .hero__ctas {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
        width: auto;
    }
}

.hero__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
}

.hero__cta:hover {
    text-decoration: none;
}

.hero__cta--primary {
    background: var(--accent);
    color: #fff;
}

.hero__cta--primary:hover {
    background: var(--accent-dark);
}

.hero__cta--secondary {
    border: 1px solid rgba(248, 245, 240, 0.4);
    color: var(--paper);
}

.hero__cta--secondary:hover {
    border-color: var(--paper);
}

/* ── Content ───────────────────────────────────────────────────── */
.site-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 40vh;
}

/* ── Footer ────────────────────────────────────────────────────── */
.site-footer {
    background: var(--ink);
    color: var(--paper);
    margin-top: 4rem;
}

.site-footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 1rem 0.5rem;
}

@media (min-width: 768px) {
    .site-footer__inner {
        padding: 4rem 1rem 3rem;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 2.5rem;
    }
}

.site-footer__brand {
    padding-bottom: 2rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(248, 245, 240, 0.1);
}

@media (min-width: 768px) {
    .site-footer__brand {
        padding-bottom: 0;
        margin-bottom: 0;
        border-bottom: none;
    }
}

/* Accordion sections (mobile/tablet) become plain grid columns at 768px+ */
.site-footer__section {
    border-bottom: 1px solid rgba(248, 245, 240, 0.1);
}

.site-footer__section:last-child {
    border-bottom: none;
}

@media (min-width: 768px) {
    .site-footer__section {
        border-bottom: none;
    }
}

.site-footer__accordion-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    padding: 1rem 0;
    text-align: left;
    color: rgba(248, 245, 240, 0.8);
    font-size: 0.875rem;
    font-weight: 600;
}

.site-footer__heading.site-footer__accordion-toggle {
    margin: 0;
}

@media (min-width: 768px) {
    .site-footer__accordion-toggle {
        pointer-events: none;
        padding: 0 0 1rem;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.15em;
        text-transform: uppercase;
        color: rgba(248, 245, 240, 0.3);
    }
}

.site-footer__accordion-chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: rgba(248, 245, 240, 0.4);
    transition: transform 0.2s ease;
}

[data-accordion].is-open .site-footer__accordion-chevron {
    transform: rotate(180deg);
}

@media (min-width: 768px) {
    .site-footer__accordion-chevron {
        display: none;
    }
}

.site-footer__section-body {
    display: none;
}

[data-accordion].is-open .site-footer__section-body {
    display: block;
}

@media (min-width: 768px) {
    .site-footer__section-body {
        display: block;
    }
}

.site-footer__logo {
    max-height: 28px;
    display: block;
    margin-bottom: 1.25rem;
}

.site-footer__wordmark {
    display: flex;
    align-items: flex-end;
    margin-bottom: 1.25rem;
    font-family: var(--font-display);
    font-size: 28px;
    line-height: 1;
    color: var(--paper);
}

.site-footer__wordmark--accent {
    color: var(--accent);
}

.site-footer__tagline {
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgba(248, 245, 240, 0.5);
    max-width: 220px;
    margin: 0 0 1.5rem;
}

.site-footer__contact {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin: 0;
    padding: 0;
}

.site-footer__contact a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: rgba(248, 245, 240, 0.55);
    transition: color 0.15s ease;
}

.site-footer__contact a:hover {
    color: var(--accent);
    text-decoration: none;
}

.site-footer__contact svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.site-footer__heading {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(248, 245, 240, 0.3);
    margin: 0 0 1rem;
}

.site-footer__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin: 0 0 1rem;
    padding: 0;
}

@media (min-width: 768px) {
    .site-footer__list {
        margin-bottom: 2rem;
    }
}

.site-footer__list a,
.site-footer__list span {
    font-size: 0.875rem;
    color: rgba(248, 245, 240, 0.55);
}

.site-footer__list a:hover {
    color: var(--accent);
    text-decoration: none;
}

.site-footer__heading--social {
    display: none;
}

@media (min-width: 768px) {
    .site-footer__heading--social {
        display: block;
        margin-top: 2rem;
    }
}

.site-footer__social {
    display: flex;
    gap: 0.625rem;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .site-footer__social {
        margin-top: 0;
        margin-bottom: 0;
    }
}

.site-footer__social a {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(248, 245, 240, 0.15);
    border-radius: var(--radius-md);
    color: rgba(248, 245, 240, 0.4);
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.site-footer__social a svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.site-footer__social a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.site-footer__bottom {
    border-top: 1px solid rgba(248, 245, 240, 0.08);
}

.site-footer__bottom-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.site-footer__copy {
    font-size: 0.75rem;
    color: rgba(248, 245, 240, 0.25);
    margin: 0;
}

.site-footer__made {
    font-size: 0.75rem;
    color: rgba(248, 245, 240, 0.2);
    margin: 0;
}

/* ── Login/registration modal ─────────────────────────────────── */

.auth-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-modal.is-open {
    display: flex;
}

.auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 12, 10, 0.5);
    backdrop-filter: blur(4px);
}

.auth-modal__card {
    position: relative;
    width: 100%;
    max-width: 28rem;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    max-height: 90vh;
    overflow-y: auto;
}

.auth-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem;
    border: none;
    background: none;
    border-radius: var(--radius-md);
    color: var(--muted);
    cursor: pointer;
    z-index: 1;
}

.auth-modal__close:hover {
    background: var(--paper);
    color: var(--ink);
}

.auth-modal__close svg {
    width: 20px;
    height: 20px;
}

.auth-modal__inner {
    padding: 1.75rem;
}

.auth-modal__logo {
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--ink);
    margin: 0 0 1.5rem;
}

.auth-modal__logo--accent {
    color: var(--accent);
}

.auth-modal__tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--paper);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

.auth-modal__tab {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.auth-modal__tab.is-active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(13, 12, 10, 0.08);
}

.auth-modal__panel {
    display: none;
}

.auth-modal__panel.is-active {
    display: block;
}

/* Shared field styling — used both by dehai-account's own Register form
   and by felogin's reskinned Login template. */
.auth-form__fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form__field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.375rem;
}

.auth-form__field input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
    color: var(--ink);
}

.auth-form__field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 31, 75, 0.15);
}

.auth-form__field-password {
    position: relative;
}

.auth-form__field-password input {
    padding-right: 2.5rem;
}

.auth-form__password-toggle {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    padding: 0;
    color: var(--muted);
    cursor: pointer;
}

.auth-form__password-toggle:hover {
    color: var(--ink);
}

.auth-form__password-toggle svg {
    width: 1rem;
    height: 1rem;
}

.auth-form__password-toggle [data-password-icon="eye-off"] {
    display: none;
}

.auth-form__field-password.is-visible .auth-form__password-toggle [data-password-icon="eye"] {
    display: none;
}

.auth-form__field-password.is-visible .auth-form__password-toggle [data-password-icon="eye-off"] {
    display: block;
}

.auth-form__divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.125rem 0;
}

.auth-form__divider::before,
.auth-form__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.auth-form__divider span {
    font-size: 0.75rem;
    color: var(--muted);
}

.auth-form__oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.auth-form__oauth:hover {
    border-color: var(--ink);
}

.auth-form__oauth svg {
    width: 1rem;
    height: 1rem;
}

.auth-form__error {
    font-size: 0.75rem;
    color: var(--accent);
    background: rgba(255, 31, 75, 0.08);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    margin: 0.375rem 0 0;
}

/* The captcha widget is a fixed-size iframe Cloudflare owns — we only place it. */
.auth-form__turnstile {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/*
 * The widget's own default size, reserved before it renders so the form does
 * not jump — and so the box has an area at all while it is still empty, which
 * is what the script loader in account.js watches for.
 */
.auth-form__turnstile .cf-turnstile {
    width: 300px;
    min-height: 65px;
}

.auth-form__forgot {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: var(--accent);
    text-decoration: none;
    margin-top: -0.5rem;
}

.auth-form__forgot:hover {
    color: var(--accent-dark);
}

.auth-form__submit {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.auth-form__submit:hover {
    background: var(--accent-dark);
}

.auth-form__switch {
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted);
    margin: 0;
}

.auth-form__switch button {
    border: none;
    background: none;
    padding: 0;
    font-size: inherit;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
}

.auth-form__switch button:hover {
    color: var(--accent-dark);
}

.auth-form__legal {
    text-align: center;
    font-size: 0.6875rem;
    color: var(--muted);
    line-height: 1.5;
    margin: 0;
}

.auth-form__hidden {
    display: none;
}

.auth-form__success {
    text-align: center;
    padding: 1rem 0;
}

.auth-form__success-heading {
    font-family: var(--font-display);
    font-size: 1.125rem;
    color: var(--ink);
    margin: 0 0 0.5rem;
}

.auth-form__success-text {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.5;
    margin: 0 0 1rem;
}

.auth-form__autoopen {
    display: none;
}

/* ── 404 ──────────────────────────────────────────────────────────────
 * The page TYPO3 serves for a missing URL. Ported from the Figma
 * NotFoundPage: a ghost 404 behind a graph-paper grid, the real number
 * scrambling on hover, then the way out — two buttons and shortcut tiles.
 */

.notfound {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: calc(100vh - 120px);
    padding: 4rem 1rem;
}

.notfound__ghost {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(160px, 35vw, 380px);
    line-height: 1;
    letter-spacing: -0.02em;
    color: rgba(13, 12, 10, 0.03);
    pointer-events: none;
    user-select: none;
}

.notfound__grid {
    position: absolute;
    inset: 0;
    opacity: 0.025;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(0deg, var(--ink) 0 1px, transparent 1px 80px),
        repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 80px);
}

.notfound__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 32rem;
    text-align: center;
}

.notfound__number {
    /* Shrink-wrapped and centred, so the hover area is the number itself
       rather than the full column width. */
    display: block;
    width: fit-content;
    margin: 0 auto 1.5rem;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(72px, 18vw, 120px);
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--ink);
    cursor: default;
    user-select: none;
    transition: color 0.2s;
}

/* Set while the scramble runs — chromatic split, as in the design. */
.notfound__number.is-glitching {
    color: var(--accent);
    text-shadow: 3px 0 0 rgba(255, 31, 75, 0.3), -3px 0 0 rgba(0, 200, 255, 0.2);
}

.notfound__badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: fit-content;
    margin: 0 auto 1.25rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid rgba(255, 31, 75, 0.2);
    border-radius: var(--radius-full);
    background: rgba(255, 31, 75, 0.1);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.notfound__badge-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--accent);
    animation: notfound-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes notfound-pulse {
    50% { opacity: 0.35; }
}

.notfound__heading {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.25;
    color: var(--ink);
}

.notfound__heading-accent {
    color: var(--accent);
}

.notfound__text {
    max-width: 24rem;
    margin: 0 auto 2.5rem;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--muted);
}

.notfound__ctas {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.notfound__cta {
    width: 100%;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.notfound__cta--primary {
    background: var(--ink);
    color: var(--paper);
}

.notfound__cta--primary:hover {
    background: rgba(13, 12, 10, 0.8);
}

.notfound__cta--secondary {
    border: 1px solid var(--line);
    color: var(--ink);
}

.notfound__cta--secondary:hover {
    border-color: var(--ink);
}

.notfound__tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.notfound__tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 1rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    transition: background 0.2s, border-color 0.2s;
}

.notfound__tile:hover {
    border-color: rgba(255, 31, 75, 0.3);
    background: var(--surface-2);
}

.notfound__tile-emoji {
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.2s;
}

.notfound__tile:hover .notfound__tile-emoji {
    transform: scale(1.1);
}

.notfound__tile-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ink);
}

.notfound__hint {
    margin: 2rem 0 0;
    font-size: 0.75rem;
    color: var(--muted);
    opacity: 0.6;
}

@media (min-width: 640px) {
    .notfound__heading {
        font-size: 1.875rem;
    }

    .notfound__ctas {
        flex-direction: row;
    }

    .notfound__cta {
        width: auto;
    }

    .notfound__tiles {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .notfound__badge-dot {
        animation: none;
    }
}
