/*
 * The tokens, type scale, and component sizes here are copied from
 * gs-web-clients, so this page reads as the same product as the rest of
 * FanDuel Sports Network.
 *
 *   colors      packages/ui/src/theme/colors.css
 *   type scale  packages/ui/src/theme/typography.css
 *   components  packages/ui/tailwind.config.js and packages/ui/src/Button
 *
 * The names match theirs. Anyone who knows that repo can read this file.
 */

@font-face {
    font-family: 'national2';
    src: url('/fonts/national-2-light.woff2') format('woff2');
    font-weight: 350;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'national2';
    src: url('/fonts/national-2-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'national2';
    src: url('/fonts/national-2-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'national2';
    src: url('/fonts/national-2-extrabold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Type scale */
    --size-min: 10px;
    --size-xs: 12px;
    --size-sm: 14px;
    --size-base: 16px;
    --size-lg: 20px;
    --size-xl: 24px;
    --size-2xl: 32px;
    --size-3xl: 40px;

    --leading-tight: 100%;
    --leading-normal: 120%;
    --leading-relaxed: 140%;

    --font-light: 350;
    --font-regular: 400;
    --font-bold: 700;
    --font-extrabold: 800;

    --font-national2: 'national2';
    --font-default: var(--font-national2);

    /* Colors shared by both themes */
    --tint-rgb: 0 114 229;
    --error-rgb: 213 0 85;
    --success-rgb: 0 135 81;
    --fdsn-blue-rgb: 0 120 255;

    /* Dark is the product's default, so it is the default here too. */
    --canvas-rgb: 0 0 0;
    --surface-rgb: 21 21 21;
    --on-background-rgb: 255 255 255;
    --on-background-alt-rgb: 142 145 150;
    --button-rgb: 255 255 255;
    --button-pressed-rgb: 187 187 187;
    --on-button-rgb: 0 0 0;
    --divider-canvas-rgb: 42 43 45;
    --divider-surface-rgb: 42 43 45;
    --disabled-rgb: 51 51 51;
    --logo-rgb: 255 255 255;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme='dark']) {
        --canvas-rgb: 243 244 245;
        --surface-rgb: 255 255 255;
        --on-background-rgb: 0 0 0;
        --on-background-alt-rgb: 111 114 116;
        --button-rgb: 0 0 0;
        --button-pressed-rgb: 69 69 69;
        --on-button-rgb: 255 255 255;
        --divider-canvas-rgb: 218 218 218;
        --divider-surface-rgb: 244 244 244;
        --disabled-rgb: 225 225 225;
        --logo-rgb: var(--fdsn-blue-rgb);
    }
}

:root[data-theme='light'] {
    --canvas-rgb: 243 244 245;
    --surface-rgb: 255 255 255;
    --on-background-rgb: 0 0 0;
    --on-background-alt-rgb: 111 114 116;
    --button-rgb: 0 0 0;
    --button-pressed-rgb: 69 69 69;
    --on-button-rgb: 255 255 255;
    --divider-canvas-rgb: 218 218 218;
    --divider-surface-rgb: 244 244 244;
    --disabled-rgb: 225 225 225;
    --logo-rgb: var(--fdsn-blue-rgb);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: rgb(var(--canvas-rgb));
    color: rgb(var(--on-background-rgb));
    font-family: var(--font-default), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: var(--size-base);
    font-weight: var(--font-regular);
    line-height: var(--leading-relaxed);
    -webkit-font-smoothing: antialiased;
}

main {
    max-width: 36rem;
    margin: 0 auto;
    padding: 2rem 1.25rem 5rem;
}

/* The product shows a white mark on dark and the FanDuel blue on light, which
   is the `--logo-rgb` token in the shared package. Two files served from the
   CDN do the same job here without inlining 7KB into every page render. */
.logo {
    display: block;
    width: 200px;
    height: 57px;
    margin-bottom: 2.5rem;
    background: no-repeat left center / contain url('/logo-dark.svg');
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme='dark']) .logo {
        background-image: url('/logo-light.svg');
    }
}

:root[data-theme='light'] .logo {
    background-image: url('/logo-light.svg');
}

/* heading-3 from the shared config: --size-xl, extrabold, 120% */
h1 {
    font-size: var(--size-xl);
    font-weight: var(--font-extrabold);
    line-height: var(--leading-normal);
    margin: 0 0 1.5rem;
}

/* sub-heading-2: --size-lg, light, 120% */
.sub-heading {
    font-size: var(--size-lg);
    font-weight: var(--font-light);
    line-height: var(--leading-normal);
    margin: 0 0 1.5rem;
}

p {
    margin: 0 0 1.15rem;
}

strong {
    font-weight: var(--font-bold);
}

/* The address the person is acting on, on a surface so it reads as a fact
   about their account rather than another sentence. */
.account {
    background: rgb(var(--surface-rgb));
    border: 1px solid rgb(var(--divider-surface-rgb));
    border-radius: 4px;
    padding: 1rem;
    margin: 0 0 1.5rem;
    overflow-wrap: anywhere;
}

.account .label {
    display: block;
    font-size: var(--size-xs);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    text-transform: uppercase;
    color: rgb(var(--on-background-alt-rgb));
    margin-bottom: 0.35rem;
}

.account .value {
    font-size: var(--size-lg);
    font-weight: var(--font-bold);
    line-height: var(--leading-normal);
}

form {
    margin: 2rem 0;
}

/* Input.Container from the shared package: rounded border p-4 h-14 */
label[for] {
    display: block;
    font-size: var(--size-xs);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    text-transform: uppercase;
    color: rgb(var(--on-background-alt-rgb));
    margin-bottom: 0.5rem;
}

input[type='email'] {
    width: 100%;
    height: 56px;
    padding: 1rem;
    font-family: inherit;
    font-size: var(--size-base);
    color: rgb(var(--on-background-rgb));
    background: transparent;
    border: 1px solid rgb(var(--disabled-rgb));
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

input[type='email']:focus {
    outline: none;
    border-color: rgb(var(--on-background-rgb));
}

/* The two choices. Each label wraps its radio, so the whole row is a target,
   which is what a thumb needs on a phone. */
fieldset {
    border: 0;
    padding: 0;
    /* Wider than the gap between the two choices, so the button reads as the
       next step rather than a third option. */
    margin: 0 0 2.5rem;
}

legend {
    padding: 0;
    font-size: var(--size-xs);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    text-transform: uppercase;
    color: rgb(var(--on-background-alt-rgb));
    margin-bottom: 0.5rem;
}

.choice {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: rgb(var(--surface-rgb));
    border: 1px solid rgb(var(--disabled-rgb));
    border-radius: 4px;
    cursor: pointer;
}

.choice:has(input:checked) {
    border-color: rgb(var(--on-background-rgb));
}

.choice:focus-within {
    outline: 2px solid rgb(var(--tint-rgb));
    outline-offset: 2px;
}

.choice input[type='radio'] {
    width: 20px;
    height: 20px;
    margin: 0;
    flex: none;
    /* The default control is 13px and grey in both themes, which disappears on
       black. Accent color keeps the native control and its keyboard behavior. */
    accent-color: rgb(var(--fdsn-blue-rgb));
}

/* Success-colored, because it reports a state rather than a problem the way
   `.notice` does. */
.confirmation {
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: rgb(var(--surface-rgb));
    border-left: 3px solid rgb(var(--success-rgb));
    border-radius: 4px;
    font-size: var(--size-sm);
}

/* Button, size `form` (h-14 px-4), variant `primary`. Primary in the shared
   package is the on-background color with canvas-colored text, which inverts
   with the theme. */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 56px;
    padding: 0 1rem;
    font-family: inherit;
    font-size: var(--size-base);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    text-transform: uppercase;
    text-align: center;
    color: rgb(var(--on-button-rgb));
    background: rgb(var(--button-rgb));
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background: rgb(var(--button-rgb) / 0.9);
}

button:active {
    background: rgb(var(--button-pressed-rgb));
}

/* caption-sm: --size-sm, regular, 140% */
.secondary,
.fallback {
    font-size: var(--size-sm);
    color: rgb(var(--on-background-alt-rgb));
}

.notice {
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: rgb(var(--surface-rgb));
    border-left: 3px solid rgb(var(--error-rgb));
    border-radius: 4px;
    font-size: var(--size-sm);
}

hr {
    height: 1px;
    border: 0;
    background: rgb(var(--divider-canvas-rgb));
    margin: 2rem 0;
}

a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

a:hover {
    color: rgb(var(--tint-rgb));
}

@media (min-width: 480px) {
    main {
        padding-top: 3.5rem;
    }

    button {
        width: auto;
        min-width: 14rem;
    }
}
