@import url("../branding/brand.css");
/* CSS Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

::selection {
    color: hsl(var(--bg));
    background: hsl(var(--action));
}

input,
button,
textarea,
select {
    font: inherit;
}

/* Try to uniform scrollbars at least a bit */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-thumb {
    background-color: hsl(var(--bg-high));
    border-radius: 30px;
}

::-webkit-scrollbar-corner {
    display: none;
}

/* some parts are disabled until we actually have a theme switch and fixed all components */
body {
    width: 100%;
    height: 100dvh;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        'Roboto',
        'Segoe UI',
        'Oxygen',
        'Ubuntu',
        'Cantarell',
        'Fira Sans',
        'Droid Sans',
        'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5rem;
    color: hsl(var(--text));
    background-color: hsl(var(--bg));
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
    overflow: auto;

    display: flex;
    --animate-zoom: zoomIn 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
    --din-a4-width: 595pt;
    --din-a4-height: 842pt;
}

a,
a:link,
a:visited {
    color: hsl(var(--text));
    transition: all 150ms ease-in-out;
}

a:hover,
a:active {
    color: hsl(var(--action));
    text-decoration: underline;
}

blockquote {
    padding-left: 0.33rem;
    border-left: 3px solid hsl(var(--accent));
    border-radius: var(--border-radius);
    background-color: hsl(var(--bg-high));
}

code {
    padding: 0 0.15rem;
    font-size: 0.9rem;
    background: hsl(var(--bg-high));
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: hsl(var(--text-high));
    overflow-wrap: break-word;
}

h1 {
    font-size: 1.5rem;
    margin: 1rem 0;
    letter-spacing: -0.04em;
}

h2 {
    font-size: 1.35rem;
    margin: 0.75rem 0;
    letter-spacing: -0.03em;
}

h3 {
    font-size: 1.25rem;
    margin: 0.6rem 0;
    letter-spacing: -0.025em;
}

h4 {
    font-size: 1.2rem;
    margin: 0.65rem 0;
    letter-spacing: -0.015em;
}

h5 {
    font-size: 1.05rem;
    margin: 0.55rem 0;
    letter-spacing: -0.01em;
}

p {
    margin: 0.5rem 0;
    /*
    595pt is exactly the width of DIN A4, the height would be 842pt.
    If you calculate for typical borders of  2.0 - 2.5 cm you get 57pt - 71pt on each side.
    To match typical DIN A4 writing widths, keep the max-width between 595 - 2 * 57 and 595 - 2 * 71 pt,
    meaning between 453pt and 481pt.
    Usually, you have 2,5cm on left, top, bottom, and 2cm on the right side, which will result in 467pt.
    */
    max-width: 467pt;
}

hr {
    border: none;
    border-top: 1px solid hsl(var(--bg-high));
    margin: 0.5rem 0;
}

li {
    margin-left: 1rem;
}

.font-default {
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        'Roboto',
        'Segoe UI',
        'Oxygen',
        'Ubuntu',
        'Cantarell',
        'Fira Sans',
        'Droid Sans',
        'Helvetica Neue',
        sans-serif;
}

.font-label {
    font-family:
        ui-rounded, 'Hiragino Maru Gothic ProN', Quicksand, Comfortaa, Manjari, 'Arial Rounded MT',
        'Arial Rounded MT Bold', Calibri, source-sans-pro, sans-serif;
}

.font-mono {
    font-family:
        ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono',
        monospace;
}

.absolute {
    position: absolute;
}

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

.action {
    color: hsl(var(--action));
}

.clip {
    overflow: clip;
}

.err {
    color: hsl(var(--error));
}

.relative {
    position: relative;
}

.flex {
    display: flex;
    align-items: center;
}

.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-3 {
    flex: 3;
}

.gap-05 {
    gap: 0.5rem;
}

.gap-10 {
    gap: 1rem;
}

.gap-15 {
    gap: 1.5rem;
}

.gap-20 {
    gap: 2rem;
}

.hidden {
    height: 0;
    width: 0;
    display: none;
}

.m-05 {
    margin: 0.5rem;
}

.m-10 {
    margin: 1rem;
}

.ms-05 {
    margin: 0 0.5rem;
}

.ms-10 {
    margin: 0 1rem;
}

.mh-05 {
    margin: 0.5rem 0;
}

.mh-10 {
    margin: 1rem 0;
}

.noselect {
    user-select: none;
}

.pointer {
    cursor: pointer;
}

.space-between {
    justify-content: space-between;
}

.text {
    color: hsl(var(--text));
}

.zoom {
    animation: var(--animate-zoom);
}

label[data-required='true']:after {
    content: ' *';
    color: hsla(var(--error) / 0.9);
}

.info {
    overflow: auto;
}

input,
.input {
    margin: 0.33rem 0;
    padding: 0.25rem 0.5rem;
    background: hsl(var(--bg));
    color: hsl(var(--text));
    font-size: 1.05rem;
    outline: none;
    transition: 150ms all;
    border: 1px solid hsla(var(--text) / 0.2);
    border-radius: var(--border-radius);
}
input {
    width: 100%;
}

input:focus {
    border-color: hsla(var(--text) / 0.4);
}

/* Prevent native :invalid styles from showing */
input:invalid {
    box-shadow: none;
}

input.invalid {
    border-color: hsl(var(--error));
}

input.invalid:focus {
    border-color: hsl(var(--error));
}

input:hover,
input:focus {
    color: hsl(var(--text-high));
    background: hsla(var(--action) / 0.03);
}

input:disabled {
    background: hsl(var(--bg-high));
    cursor: not-allowed;
}

pre {
    background: hsl(var(--bg-high));
}

.html-render {
    display: block;
    line-height: 1.5rem;
}

.html-render input {
    width: inherit;
    margin: inherit;
    border: inherit;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    color: hsl(var(--text));
    font-size: 1.05rem;
    outline: inherit;
}

.html-render ol,
.html-render ul {
    padding-left: 1rem;
}

.html-render p {
    margin: 0.5rem 0;
    max-width: 467pt;
}

.html-render blockquote {
    padding-left: 0.33rem;
    border-left: 3px solid hsl(var(--accent));
    border-radius: var(--border-radius);
    background-color: hsl(var(--bg-high));
}

.fade-in {
    animation: fadeIn 200ms;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
    }
    to {
        transform: scale(1);
    }
}

/* Authentication: a quiet, editorial shell; client theme tokens stay authoritative. */
:where(.auth-page) {
    --text: 150 8% 32%; --text-high: 150 16% 13%;
    --bg: 45 23% 96%; --bg-high: 42 17% 89%;
    --action: 153 28% 25%; --error: 0 60% 40%; --border-radius: 10px;
}
.auth-page {
    min-height: 100svh; height: auto; display: grid;
    grid-template-rows: auto 1fr auto; padding: 36px clamp(24px, 5vw, 80px);
    font-family: var(--brand-font);
    line-height: 1.6; color: hsl(var(--text)); background-color: hsl(var(--bg));
}
.auth-brand { display: flex; align-items: center; gap: 12px; color: hsl(var(--text-high)); font-size: 23px; font-weight: 600; letter-spacing: -.9px; }
.auth-panel { width: min(100%, 420px); align-self: center; justify-self: center; margin: 40px 0 48px; }
.auth-page .auth-eyebrow { margin: 0 0 16px; color: hsl(var(--action)); font-size: 11px; font-weight: 700; letter-spacing: .15em; }
.auth-panel h1 { margin: 0 0 20px; font-size: clamp(32px, 4vw, 44px); font-weight: 600; letter-spacing: -.055em; line-height: 1.2; }
.auth-panel .auth-intro, .auth-panel > p:not(.auth-eyebrow) { margin: 0 0 20px; font-size: 15px; line-height: 1.7; text-wrap: pretty; }
.auth-panel form { display: grid; gap: 14px; }
.auth-panel label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: hsl(var(--text-high)); }
.auth-panel input { margin: 0; min-height: 44px; padding: 9px 12px; font-size: 16px; border-color: hsl(var(--text) / .25); background: hsl(var(--bg)); border-radius: var(--border-radius); transition: border-color 160ms ease, background-color 160ms ease; }
.auth-panel input:focus { border-color: hsl(var(--action)); outline: 3px solid hsl(var(--action) / .16); outline-offset: 2px; }
.auth-panel input[readonly] { background: hsl(var(--bg-high)); }
.auth-panel button, .auth-panel .provider-button { width: 100%; min-height: 44px; padding: 10px 16px; border: 1px solid hsl(var(--action)); border-radius: var(--border-radius); background: hsl(var(--action)); color: var(--btn-text, #faf9f5); font-size: 14px; font-weight: 600; cursor: pointer; transition: transform 120ms ease-out, background-color 160ms ease; }
.auth-panel button[type=submit] { margin-top: 8px; }
.auth-panel button:active { transform: scale(.99); }
.auth-panel button:disabled { opacity: .6; cursor: wait; }
.auth-panel button.secondary, .auth-panel .provider-button { color: hsl(var(--text-high)); background: transparent; border-color: hsl(var(--text) / .25); }
.auth-panel .passkey-button { margin-top: -8px; }
.auth-panel .provider-button { display: block; margin-top: 12px; text-align: center; text-decoration: none; }
.auth-panel :focus-visible { outline: 3px solid hsl(var(--action) / .55); outline-offset: 4px; }
.auth-divider { display: flex; align-items: center; gap: 16px; margin: 28px 0 20px; font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: hsl(var(--text) / .2); }
.auth-footer { display: flex; justify-content: space-between; gap: 20px; font-size: 11px; letter-spacing: .025em; color: hsl(var(--text)); }
.auth-panel [role=status]:empty { display: none; }
.auth-panel [role=status]:not(:empty), .auth-error { padding: 14px 16px; border: 1px solid hsl(var(--text) / .18); border-radius: var(--border-radius); font-size: 14px; }
.auth-error { color: hsl(var(--error)); }
.auth-panel .otp-input { font-size: 26px; letter-spacing: .4em; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .auth-panel button:hover { background: color-mix(in srgb, hsl(var(--action)), black 12%); } .auth-panel button.secondary:hover, .auth-panel .provider-button:hover { background: hsl(var(--bg-high)); } }
@media (max-width: 540px) { .auth-page { padding: 24px; } .auth-panel { margin: 32px 0; } .auth-footer { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { .auth-page *, .auth-page *::before, .auth-page *::after { animation: none; transition: none; scroll-behavior: auto; } }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 28px; font-size: 12px; }
.auth-links a { text-underline-offset: 4px; }
.auth-page .auth-return { margin-top: 28px; font-size: 12px; color: hsl(var(--text)); }
.auth-page [hidden] { display: none !important; }
#registration-fields { display: grid; gap: 14px; }
.auth-panel details{border-top:1px solid hsl(var(--text) / .18);padding-top:18px}.auth-panel summary{font-size:13px;cursor:pointer;list-style-position:outside;margin-left:16px}.auth-panel details label{margin-top:12px}
.auth-panel > p.auth-return { margin: 24px 0 0; font-size: 12px; line-height: 1.7; }

.auth-brand .client-login-logo { display:block; width:auto; max-width:min(240px,60vw); height:44px; object-fit:contain; }
