@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("../fonts/nunito-latin-wght-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Josefin Sans";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/josefin-sans-latin-700-normal.woff2") format("woff2");
}

:root {
    color-scheme: dark;

    --color-background: #0b0920;
    --color-text: #f6f3ff;
    --color-text-secondary: #d2cbf0;
    --color-text-on-accent: #ffffff;
    --color-accent: #b7a6ff;
    --color-link: var(--color-accent);
    --color-danger: #ff8a98;
    --color-focus: #3fd0c9;
    --color-surface: rgb(143 116 240 / 14%);
    --color-field: rgb(143 116 240 / 14%);
    --color-surface-border: transparent;
    --color-separator: rgb(210 203 240 / 14%);

    --surface-sheen: linear-gradient(180deg, rgb(238 234 255 / 10%) 0%, rgb(255 255 255 / 0%) 60%);
    --accent-fallback: #9b3fc4;
    --accent-gradient: linear-gradient(120deg, #6a4bea 0%, #9b3fc4 55%, #c2477f 100%);
    --background-image:
        radial-gradient(ellipse 90% 60% at 12% 0%, rgb(106 75 234 / 42%) 0%, rgb(106 75 234 / 0%) 70%),
        radial-gradient(ellipse 70% 50% at 100% 28%, rgb(140 36 72 / 38%) 0%, rgb(140 36 72 / 0%) 70%),
        radial-gradient(ellipse 80% 55% at 0% 78%, rgb(43 42 122 / 55%) 0%, rgb(43 42 122 / 0%) 70%),
        radial-gradient(ellipse 70% 45% at 92% 100%, rgb(122 47 126 / 40%) 0%, rgb(122 47 126 / 0%) 70%),
        linear-gradient(180deg, #0b0920 0%, #120f2e 55%, #0b0920 100%);

    --shadow-card: 0 6px 20px rgb(5 4 15 / 35%);
    --shadow-glow: 0 0 28px rgb(143 116 240 / 35%);

    --radius-field: 14px;
    --radius-card: 20px;
    --radius-pill: 999px;

    --font-heading: "Josefin Sans", system-ui, sans-serif;
    --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --transition: 150ms ease;
}

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

html {
    background-color: var(--color-background);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0 16px 32px;
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 24px;
    color: var(--color-text);
    background-image: var(--background-image);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

.brand {
    display: flex;
    justify-content: center;
    padding: 48px 0 24px;
}

.brand img {
    display: block;
    height: auto;
}

.card {
    max-width: 26rem;
    margin: 0 auto;
    padding: 24px;
    background-color: var(--color-surface);
    background-image: var(--surface-sheen);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

h1 {
    margin: 0 0 12px;
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    line-height: 34px;
}

p {
    margin: 12px 0 0;
}

.hint {
    margin-top: 0;
    color: var(--color-text-secondary);
}

label {
    display: block;
    margin: 16px 0 4px;
    font-size: 15px;
    line-height: 20px;
    color: var(--color-text-secondary);
}

input[type=text] {
    width: 100%;
    min-height: 52px;
    padding: 12px 16px;
    font: inherit;
    color: var(--color-text);
    caret-color: var(--color-accent);
    background-color: var(--color-field);
    border: 1px solid var(--color-separator);
    border-radius: var(--radius-field);
    transition: border-color var(--transition), box-shadow var(--transition);
}

input[type=text]:focus {
    border-color: var(--color-accent);
    box-shadow: inset 0 0 0 .5px var(--color-accent);
}

input[autocomplete=one-time-code] {
    font-variant-numeric: tabular-nums;
    letter-spacing: .2em;
}

button {
    display: block;
    width: 100%;
    min-height: 48px;
    margin-top: 24px;
    padding: 12px 24px;
    font: inherit;
    font-weight: 600;
    line-height: 22px;
    color: var(--color-text-on-accent);
    background-color: var(--accent-fallback);
    background-image: var(--accent-gradient);
    border: 0;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-glow);
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition);
}

button:active {
    opacity: .78;
    transform: scale(.98);
}

button:disabled {
    opacity: .45;
    transform: none;
    cursor: wait;
}

button.link {
    display: inline-block;
    width: auto;
    min-height: 44px;
    margin-top: 8px;
    padding: 0 8px;
    margin-left: -8px;
    font-weight: 400;
    color: var(--color-link);
    background: none;
    box-shadow: none;
    text-decoration: underline;
}

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

button.link,
a {
    text-underline-offset: .15em;
}

.error {
    color: var(--color-danger);
}

:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

input[type=text]:focus-visible {
    outline-offset: 1px;
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
    :root {
        --background-image: linear-gradient(180deg, #07061a 0%, #120f2e 100%);
        --color-surface: #1a1640;
        --color-field: #241e52;
        --surface-sheen: none;
        --shadow-glow: none;
    }
}

@media (prefers-contrast: more) {
    :root {
        --color-background: #07061a;
        --color-text: #ffffff;
        --color-text-secondary: #eeeaff;
        --color-accent: #d9cfff;
        --color-surface-border: rgb(238 234 255 / 55%);
        --color-separator: rgb(238 234 255 / 55%);
        --surface-sheen: linear-gradient(180deg, rgb(255 255 255 / 18%) 0%, rgb(255 255 255 / 0%) 60%);
        --accent-fallback: #5a3fc4;
        --accent-gradient: none;
        --shadow-glow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --transition: 0s;
    }

    button:active {
        transform: none;
    }
}

@media (forced-colors: active) {
    button,
    input[type=text],
    .card {
        border: 1px solid CanvasText;
    }

    button.link {
        border: 0;
    }
}
