:root {
    color-scheme: light;
    --coffee: #3b160b;
    --coffee-deep: #281008;
    --cream: #fff7ec;
    --paper: #fffaf3;
    --gold: #e99a22;
    --ink: #331c14;
    --muted: #73594c;
    --line: #dfc1a7;
}

* {
    box-sizing: border-box;
}

body.cfb-auth-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: radial-gradient(ellipse at 50% 0, #713711, #3b160b 62%, #2c1007);
    color: var(--ink);
    font: 16px/1.45 system-ui, "Segoe UI", sans-serif;
}

.cfb-auth-shell {
    --auth-artwork: url('./welcome-reference.webp');
    --auth-top-height: 544;
    --auth-bottom-height: 222;
    width: min(100%, 30rem);
    margin-inline: auto;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 38%, #fff9f3 18%, #fff1e1 82%);
    box-shadow: 0 18px 60px #16060055;
}

.cfb-signup-page .cfb-auth-shell {
    --auth-artwork: url('./signup-reference.webp');
    --auth-top-height: 352;
    --auth-bottom-height: 206;
}

.cfb-auth-card {
    min-width: 0;
    padding: 0 clamp(18px, 7vw, 34px) 5px;
}

.cfb-auth-header {
    position: relative;
    margin-inline: calc(-1 * clamp(18px, 7vw, 34px));
    aspect-ratio: 1024 / var(--auth-top-height);
    background: var(--auth-artwork) top center / 100% auto no-repeat;
}

.cfb-auth-brand {
    position: absolute;
    inset: 4% 25% 1%;
    border-radius: 9px;
}

.cfb-auth-brand img {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
}

.cfb-auth-language {
    position: absolute;
    z-index: 1;
    inset: 8px 9px auto auto;
    font-size: 0;
}

.cfb-auth-language select {
    min-height: 44px;
    max-width: min(45vw, 146px);
    padding: 4px 8px;
    border: 1px solid #e7a951;
    border-radius: 12px;
    background: #fff6e8;
    color: var(--coffee);
    font: 700 12px system-ui, sans-serif;
    cursor: pointer;
}

.cfb-auth-card h1 {
    margin: 5px 0 0;
    text-align: center;
    font-size: clamp(26px, 8.5vw, 38px);
    font-weight: 850;
    line-height: 1.06;
    letter-spacing: -.04em;
}

.cfb-auth-intro {
    margin: 7px 0 16px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.cfb-auth-form,
.cfb-auth-field {
    display: grid;
    min-width: 0;
}

.cfb-auth-form {
    gap: 12px;
}

.cfb-auth-field {
    gap: 4px;
}

.cfb-auth-field label,
#verification label {
    font-size: 13px;
    font-weight: 760;
}

.cfb-auth-optional {
    color: var(--muted);
    font-weight: 400;
}

.cfb-auth-form input:not([type=checkbox]):not([type=hidden]) {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
}

.cfb-password-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
}

.cfb-auth-form .cfb-password-field input:not([type=checkbox]):not([type=hidden]) {
    border: 0;
    background: transparent;
}

.cfb-password-toggle {
    border: 0;
    padding: 0 10px;
    min-height: 44px;
    border-radius: 8px;
    background: transparent;
    color: #844612;
    font: 700 13px system-ui, sans-serif;
    cursor: pointer;
}

.cfb-auth-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0 9px;
    font-size: 13px;
}

.cfb-auth-options label,
.cfb-auth-options a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cfb-auth-options input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #854415;
}

.cfb-auth-card a {
    color: #80410e;
    text-underline-offset: .18em;
}

.cfb-auth-primary {
    width: 100%;
    min-height: 48px;
    border: 1px solid #a75810;
    border-radius: 11px;
    padding: 7px 10px;
    background: linear-gradient(105deg, #431705 3%, #7c3004 53%, #a74c05);
    box-shadow: 0 4px 10px #7a35092c;
    color: #fff;
    font: 800 16px system-ui, sans-serif;
    cursor: pointer;
}

.cfb-auth-primary:hover {
    background: #71390f;
}

.cfb-auth-primary:active {
    background: var(--coffee-deep);
}

.cfb-auth-card :is(input,
button,
select,
a):focus-visible {
    outline: 2px solid #9b5417;
    outline-offset: 2px;
}

.cfb-auth-alternate {
    margin: 12px 0 0;
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    font-size: 14px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.cfb-auth-alternate a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-weight: 750;
}

.auth-errors {
    padding: 8px 10px;
    margin: 0 0 12px;
    border-radius: 8px;
    background: #f9e4d8;
    color: #79270e;
    overflow-wrap: anywhere;
    font-size: 13px;
}

ul.auth-errors {
    padding-inline-start: 28px;
}

#referrer:empty {
    display: none;
}

#referrer {
    background: #fae9d4;
    color: #783710;
    border-radius: 8px;
    padding: 7px 8px;
    overflow-wrap: anywhere;
    font-size: 13px;
}

#referrer span {
    margin-inline-end: 5px;
}

.cfb-auth-visual {
    aspect-ratio: 1024 / var(--auth-bottom-height);
    background: var(--auth-artwork) bottom center / 100% auto no-repeat;
}

#verification {
    width: min(calc(100% - 24px), 24rem);
    max-height: calc(100dvh - 20px);
    overflow: auto;
    padding: clamp(14px, 4vw, 24px);
    border: 1px solid var(--gold);
    border-radius: 18px;
    background: var(--cream);
    color: var(--ink);
    box-shadow: 0 14px 45px #3b160b55;
}

#verification::backdrop {
    background: #2b130ab5;
}

#verification h2 {
    margin: 0 0 5px;
    font-size: clamp(19px, 5vw, 24px);
}

#verification-help {
    margin: 0;
    font-size: 14px;
}

.cfb-captcha-code {
    margin: 12px 0;
    padding: 10px 7px;
    border-radius: 10px;
    background: #f6e5d0;
    text-align: center;
    font: 700 24px ui-monospace, monospace;
    letter-spacing: .24em;
}

#verification label {
    display: block;
    margin-bottom: 5px;
}

.cfb-captcha-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.cfb-captcha-actions button {
    min-height: 44px;
}

#cancel {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    color: var(--coffee);
    font: inherit;
    cursor: pointer;
}

@media (min-width: 34rem) {
    body.cfb-auth-page {
        padding-block: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-bottom));
    }
    .cfb-auth-shell {
        border: 1px solid #fce6c968;
        border-radius: 22px;
    }
}

.cfb-mobile-field {
    position: relative;
    min-width: 0;
}

.cfb-mobile-prefix {
    position: absolute;
    inset-inline-start: 10px;
    inset-block: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding-inline-end: 8px;
    border-inline-end: 1px solid var(--line);
    font-size: .875em;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
}

.cfb-mobile-prefix img {
    display: block;
    flex: none;
}

.cfb-auth-form .cfb-mobile-field input[type="tel"] {
    padding-inline-start: 78px;
}