/* ==========================================================================
   Authentication screens (sign up, sign in, email verification)

   Built from the PiesaGiving v3 Figma frames (1440px desktop). Sizes are the
   frame values; colours were sampled from the frames and, where a sample was
   too small to read reliably, taken from the existing site palette
   (#0061A6 brand blue for links, #707070 for secondary text).
   ========================================================================== */

:root {
    --auth-page-bg: #F5F7FF;
    --auth-card-bg: #FFFFFF;
    --auth-text: #121212;
    --auth-muted: #707070;
    --auth-hint: #8E939C;
    --auth-border: #E7E9EE;
    --auth-primary: #0065A3;
    --auth-link: #0061A6;
    --auth-icon: #9CA1AA;
    --auth-error: #D93025;
    --auth-success: #1E8E3E;
    --auth-avatar-bg: #EBF6FE;
    --auth-avatar-fg: #C0E0F6;
    --auth-option-active-bg: #EDF7FF;
    --auth-option-active-border: #9CC6E4;

    /* One height / radius scale shared by every control. */
    --auth-control-h: 46px;
    --auth-control-r: 6px;
    --auth-btn-h: 58px;
    --auth-btn-r: 24px;
}

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

html { -webkit-text-size-adjust: 100%; }

body.auth-page {
    margin: 0;
    min-height: 100vh;
    background: var(--auth-page-bg);
    color: var(--auth-text);
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.auth-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 95px 20px 75px;
}

/* Sign in / verification frames sit the card in the middle of the viewport. */
.auth-shell--center { justify-content: center; padding-top: 60px; padding-bottom: 60px; }

/* The logo bar stays pinned while the page scrolls; the shadow/clip pair paints the
   page background edge to edge behind it so content passes underneath cleanly. */
.auth-logo {
    position: sticky;
    top: 0;
    z-index: 10;
    display: block;
    flex: none;
    margin: -20px 0;
    padding: 20px 0;
    line-height: 0;
    background: var(--auth-page-bg);
    box-shadow: 0 0 0 100vmax var(--auth-page-bg);
    clip-path: inset(0 -100vmax);
}
.auth-logo img { display: block; height: 31px; width: auto; max-width: 100%; }
.auth-logo:focus-visible { outline: 2px solid var(--auth-link); outline-offset: 5px; border-radius: 5px; }

.auth-card {
    width: 100%;
    max-width: 880px;
    margin-top: 40px;
    padding: 41px 40px 40px;
    background: var(--auth-card-bg);
    border-radius: 20px;
}

.auth-card--narrow { max-width: 600px; }

.auth-title {
    margin: 0;
    font-size: 24px;
    font-weight: 500;
    line-height: 36px;
    text-align: center;
    color: var(--auth-text);
}

.auth-subtitle {
    margin: 11px 0 0;
    font-size: 14px;
    line-height: 21px;
    text-align: center;
    color: var(--auth-text);
}

/* ---- Messages ---------------------------------------------------------- */

.auth-alert {
    margin: 20px 0 0;
    padding: 10px 15px;
    border-radius: 7.5px;
    font-size: 15px;
}
.auth-alert--error { background: #FDECEA; color: var(--auth-error); }
.auth-alert--success { background: #E6F4EA; color: var(--auth-success); }

/* ---- Profile photo ----------------------------------------------------- */

.auth-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 35px;
}

.auth-avatar__circle {
    display: block;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--auth-avatar-bg);
    cursor: pointer;
}
.auth-avatar__circle svg,
.auth-avatar__circle img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* The rule above would otherwise override [hidden] and stack the preview under the placeholder. */
.auth-avatar__circle [hidden] { display: none; }

.auth-avatar__link {
    margin-top: 7.5px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--auth-link);
    text-decoration: underline;
    cursor: pointer;
}

/* Kept in the DOM (and in the form) but visually hidden. */
.auth-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Organisation type cards ------------------------------------------- */

.auth-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    /* Pulled up into the form's top margin: the Figma frame has 57px from the
       title to the cards, against 61px from the title to the first field. */
    margin: -4px 0 28px;
    padding: 0;
    border: 0;
}

/* flex: both cards in a row grow to the taller one when a narrow phone wraps the text. */
.auth-option { position: relative; display: flex; cursor: pointer; }
.auth-option input { position: absolute; opacity: 0; pointer-events: none; }

.auth-option__box {
    display: block;
    flex: 1 1 auto;
    /* A minimum, not a fixed height: on a narrow phone (iPhone, 402px) the title and
       description wrap and the card grows instead of the text spilling out. */
    min-height: 102px;
    padding: 17.5px 17.5px 14px;
    border: 1px solid var(--auth-border);
    border-radius: 15px;
    background: #FFFFFF;
}
.auth-option input:checked + .auth-option__box {
    border-color: var(--auth-option-active-border);
    background: var(--auth-option-active-bg);
}
.auth-option input:focus-visible + .auth-option__box { outline: 2px solid var(--auth-link); outline-offset: 2px; }

.auth-option__icon { display: block; width: 20px; height: 20px; color: var(--auth-link); }
.auth-option__title {
    display: block;
    margin-top: 7.5px;
    font-size: 17px;
    font-weight: 500;
    line-height: 22px;
    color: var(--auth-text);
}
.auth-option__desc {
    display: block;
    font-size: 13px;
    line-height: 17px;
    color: var(--auth-muted);
}

/* ---- Form layout ------------------------------------------------------- */

.auth-form { margin-top: 31px; }

.auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 12px;
}

.auth-grid + .auth-grid { margin-top: 12px; }

.auth-field { position: relative; min-width: 0; }
.auth-field--full { grid-column: 1 / -1; }

.auth-section-title {
    grid-column: 1 / -1;
    margin: 9px 0 2px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: var(--auth-text);
}

.auth-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    color: var(--auth-text);
}

.auth-input {
    display: block;
    width: 100%;
    height: var(--auth-control-h);
    margin: 0;
    padding: 0 14px;
    border: 1px solid #D0D5DD;
    border-radius: var(--auth-control-r);
    background-color: #FFFFFF;
    font: inherit;
    font-size: 14px;
    line-height: normal;
    color: var(--auth-text);
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s ease;
}
.auth-input::placeholder { color: var(--auth-hint); opacity: 1; }
.auth-input:focus { border-color: var(--auth-link); }
.auth-input.error { border-color: var(--auth-error); }

/* Browser autofill: keep the white field and dark text instead of the
   pale yellow/blue fill Chrome and Safari paint over saved values. */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--auth-text);
    -webkit-box-shadow: 0 0 0 1000px #FFFFFF inset;
    box-shadow: 0 0 0 1000px #FFFFFF inset;
    caret-color: var(--auth-text);
    transition: background-color 9999s ease-out 0s;
}
.auth-input:autofill { background-color: #FFFFFF; }
/* Chrome draws a value it fills in as the page loads (a saved email and password) in
   its own default font until the page is clicked; keep it in the form's font. */
.auth-input:-webkit-autofill::first-line {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
}

select.auth-input {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none' stroke='%239CA1AA' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 3.75 5 6.25l2.5-2.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12.5px 12.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
select.auth-input::-ms-expand { display: none; }
select.auth-input:invalid,
select.auth-input option[value=""] { color: var(--auth-muted); }

.auth-input--date {
    padding-right: 45px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none' stroke='%239CA1AA' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2.75' width='10' height='9.25' rx='1.5'/%3E%3Cpath d='M2 5.75h10M4.75 1.5v2.5M9.25 1.5v2.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 17.5px 17.5px;
}

.auth-hint {
    grid-column: 1 / -1;
    margin: -1px 0 5px;
    font-size: 13px;
    line-height: 17.5px;
    color: var(--auth-hint);
}

/* jquery.validate and the duplicate username/email checks write here. */
.auth-field label.error,
.auth-field .auth-field-error {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 400;
    line-height: 16px;
    color: var(--auth-error);
}
.auth-field .auth-field-error:empty { display: none; }

/* ---- Password show/hide (button injected by password_toggle.js) -------- */

.pw-toggle {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--auth-control-h);
    height: var(--auth-control-h);
    padding: 0;
    border: 0;
    border-radius: var(--auth-control-r);
    background: transparent;
    color: var(--auth-icon);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.pw-toggle:hover,
.pw-toggle.is-on { color: var(--auth-link); }
.pw-toggle:focus-visible { outline: 2px solid var(--auth-link); outline-offset: -2px; }
.pw-toggle svg { display: block; width: 17.5px; height: 17.5px; stroke-width: 1.7; }
input.has-pw-toggle { padding-right: 50px; }

/* ---- Agreements -------------------------------------------------------- */

.auth-checks { display: grid; row-gap: 2px; margin-top: 16px; }

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 15px;
    line-height: 22.5px;
    color: var(--auth-text);
}

.auth-check input[type="checkbox"] {
    flex: none;
    width: 14px;
    height: 14px;
    margin: 4.5px 0 0;
    border: 1px solid #D5D9E0;
    border-radius: 2px;
    background: #FFFFFF;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.auth-check input[type="checkbox"]:checked {
    border-color: var(--auth-primary);
    background: var(--auth-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.5 5.2 1.7 1.7 3.3-3.6'/%3E%3C/svg%3E") center / 11px 11px no-repeat;
}
.auth-check input[type="checkbox"]:focus-visible { outline: 2px solid var(--auth-link); outline-offset: 1px; }
.auth-check label { cursor: pointer; }
.auth-check a { color: var(--auth-link); text-decoration: none; }
.auth-check a:hover { text-decoration: underline; }
.auth-check-error { display: block; margin: -2px 0 0 24px; font-size: 13px; line-height: 16px; color: var(--auth-error); }
.auth-check-error:empty { display: none; }

/* Sign in / verification: one column, a little more air between fields. */
.auth-stack { display: grid; row-gap: 21px; }

.auth-forgot {
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 18px;
    text-align: right;
}

/* ---- Actions ----------------------------------------------------------- */

.auth-btn {
    display: block;
    width: 100%;
    height: var(--auth-btn-h);
    margin-top: 34px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--auth-btn-r);
    background: var(--auth-primary);
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: var(--auth-btn-h);
    color: #FFFFFF;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color .15s ease;
}
.auth-btn--signin { margin-top: 62.5px; }
.auth-btn--verify { margin-top: 29px; }
.auth-btn:hover { background: #00578C; }
.auth-btn:active { background: #004B79; }
.auth-btn:focus-visible { outline: 2px solid var(--auth-link); outline-offset: 2px; }
.auth-btn:disabled { opacity: .6; cursor: not-allowed; }
/* A secondary action above the main form (send the verification email again). */
.auth-btn--secondary { margin-top: 0; background: #FFFFFF; color: var(--auth-primary); box-shadow: inset 0 0 0 1px var(--auth-primary); }
.auth-btn--secondary:hover { background: #EEF5FB; }
.auth-btn--secondary:active { background: #E1EDF7; }
.auth-resend-intro { margin: 0; font-size: 13px; line-height: 20px; color: var(--auth-text); }
/* Keeps the resend box apart from the sign in form below it. */
.auth-resend-box { padding-bottom: 32px; border-bottom: 1px solid var(--auth-border); }

.auth-switch {
    margin: 12px 0 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 21px;
    text-align: center;
    color: var(--auth-text);
}

.auth-link {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 500;
    color: var(--auth-link);
    text-decoration: none;
    cursor: pointer;
}
.auth-link:hover { text-decoration: underline; }

.auth-resend {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 21px;
    text-align: center;
}

/* ---- Forgot password flow ------------------------------------------------

   Forgot Password, Verification Code and Reset Password, from the Figma
   "User - Forgot password" frames at 100%: 600px card with 40px padding,
   24px title, 14px body, 12px labels, six 70px code boxes. The border, button
   and link colours are the frames' own. */

.auth-card--recover {
    --auth-border: #CFD4DD;
    --auth-primary: #004CA5;
    --auth-link: #0057A8;
    --auth-recover-error: #C60001;
    padding: 41px 40px 40px;
}
.auth-card--recover .auth-title { font-size: 24px; line-height: 36px; }
.auth-card--recover .auth-title + .auth-form { margin-top: 29px; }
.auth-card--recover .auth-recover-sub + .auth-form { margin-top: 32px; }
.auth-card--recover .auth-stack { row-gap: 18px; }
.auth-card--recover .auth-label { margin-bottom: 7px; font-size: 12px; line-height: 18px; }
.auth-card--recover .auth-input { font-size: 14px; }
.auth-card--recover .auth-input.is-error { border-color: #EF0003; background-color: #FFF7F7; }
.auth-card--recover .auth-btn { margin-top: 32px; font-size: 16px; }
.auth-card--recover .auth-btn:hover { background: #00418D; }
.auth-card--recover .auth-btn:active { background: #003A7E; }

.auth-recover-sub {
    max-width: 480px;
    margin: 7px auto 0;
    font-size: 14px;
    line-height: 21px;
    text-align: center;
    color: #6B7072;
}

.auth-recover-error { margin: 8px 0 0; font-size: 14px; line-height: 21px; color: var(--auth-recover-error); }
.auth-recover-error:empty { display: none; }

.auth-back { margin: 12px 0 0; font-size: 14px; font-weight: 500; line-height: 21px; text-align: center; }
.auth-back a { color: var(--auth-text); text-decoration: none; }
.auth-back a:hover { text-decoration: underline; }
.auth-back a:focus-visible { outline: 2px solid var(--auth-link); outline-offset: 2px; border-radius: 3px; }

.auth-card--recover .auth-recover-sub + .auth-form--code { margin-top: 51px; }

.auth-code { display: flex; justify-content: center; gap: 12px; }

.auth-code__box {
    flex: 0 1 70px;
    min-width: 0;
    height: 70px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    background: #FFFFFF;
    font: inherit;
    font-size: 24px;
    line-height: normal;
    text-align: center;
    color: var(--auth-text);
    caret-color: var(--auth-primary);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s ease;
}
.auth-code__box:focus { border-color: var(--auth-primary); }
.auth-code.is-error .auth-code__box { border-color: #EF0003; background: #FFF7F7; }

.auth-code-msg { margin: 13px 0 0; font-size: 14px; line-height: 21px; text-align: center; }
.auth-code-msg--error { color: var(--auth-recover-error); }
.auth-code-msg--notice { color: var(--auth-success); }

.auth-code-resend { margin: 36px 0 0; font-size: 13.5px; font-weight: 400; line-height: 20px; text-align: center; }
.auth-code-resend a { color: var(--auth-link); text-decoration: underline; text-underline-offset: 0.5px; }
.auth-code-resend a:focus-visible { outline: 2px solid var(--auth-link); outline-offset: 2px; border-radius: 3px; }
.auth-code-msg + .auth-code-resend { margin-top: 34px; }
.auth-card--recover .auth-code-resend + .auth-btn { margin-top: 18px; }

@media (max-width: 600px) {
    .auth-card--recover { padding: 24px 18px; }
    .auth-code { gap: 8px; }
    .auth-code__box { height: auto; aspect-ratio: 1 / 1; }
    .auth-card--recover .auth-input { font-size: 14px; }
}

/* ---- jQuery UI datepicker, toned to match the form --------------------- */

.ui-datepicker.ui-widget {
    width: 296px;
    margin-top: 6px;
    padding: 12px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: var(--auth-card-bg);
    box-shadow: 0 12px 32px rgba(18, 34, 66, 0.14);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: var(--auth-text);
    z-index: 20 !important;
}
.ui-datepicker .ui-datepicker-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 34px 10px;
    border: 0;
    border-radius: 0;
    background: none;
}
.ui-datepicker .ui-datepicker-title { display: flex; gap: 6px; margin: 0; line-height: 1; }
.ui-datepicker .ui-datepicker-title select {
    width: auto;
    margin: 0;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-control-r);
    background: var(--auth-card-bg);
    font: inherit;
    font-weight: 500;
    color: var(--auth-text);
    cursor: pointer;
}
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    top: 0;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
}
.ui-datepicker .ui-datepicker-prev { left: 0; }
.ui-datepicker .ui-datepicker-next { right: 0; }
.ui-datepicker .ui-datepicker-prev-hover,
.ui-datepicker .ui-datepicker-next-hover { top: 0; border: 0; background: var(--auth-option-active-bg); }
.ui-datepicker .ui-datepicker-prev-hover { left: 0; }
.ui-datepicker .ui-datepicker-next-hover { right: 0; }
.ui-datepicker .ui-state-disabled.ui-datepicker-prev,
.ui-datepicker .ui-state-disabled.ui-datepicker-next { opacity: 0.3; cursor: default; }
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    background: none;
    border: solid var(--auth-text);
    border-width: 0 0 1.6px 1.6px;
    text-indent: -9999px;
    transform: translateX(1px) rotate(45deg);
}
.ui-datepicker .ui-datepicker-next span { transform: translateX(-1px) rotate(-135deg); }
.ui-datepicker table { width: 100%; margin: 0; font-size: 14px; border-collapse: collapse; }
.ui-datepicker th { padding: 6px 0; font-weight: 500; font-size: 13px; color: var(--auth-muted); }
.ui-datepicker td { padding: 2px; }
.ui-datepicker td a.ui-state-default,
.ui-datepicker td span.ui-state-default {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--auth-text);
    text-align: center;
}
.ui-datepicker td a.ui-state-default:hover { background: var(--auth-option-active-bg); color: var(--auth-link); }
.ui-datepicker td a.ui-state-highlight { box-shadow: inset 0 0 0 1px var(--auth-option-active-border); color: var(--auth-link); }
.ui-datepicker td a.ui-state-active,
.ui-datepicker td a.ui-state-active:hover { background: var(--auth-link); color: #fff; box-shadow: none; }
.ui-datepicker td.ui-state-disabled { opacity: 1; }
.ui-datepicker td.ui-state-disabled span.ui-state-default { color: #C9CCD2; }
.ui-datepicker td.ui-datepicker-other-month { visibility: hidden; }

/* ---- Sign up: the card fits the window, its fields scroll inside it ----

   As in the Figma frames: the title stays at the top of the card, the fields
   scroll beneath it and are clipped 32px above the Sign up button, which stays
   pinned at the bottom with the log in link. */

.auth-shell--scroll {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding-top: clamp(24px, 9.3vh, 100px);
    padding-bottom: clamp(24px, 9.3vh, 100px);
}

.auth-card--scroll {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-height: 0;
}

.auth-card--scroll .auth-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.auth-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* 4px of room for focus outlines at the edges; on the right the scrollbar
       sits in the card's padding, so the fields keep the button's width. */
    margin: -4px -26px 0 -4px;
    padding: 4px 20px 4px 4px;
    scrollbar-gutter: stable;
}
.auth-scroll::-webkit-scrollbar { width: 6px; }
.auth-scroll::-webkit-scrollbar-track { background: transparent; }
.auth-scroll::-webkit-scrollbar-thumb { background: #D5D9E0; border-radius: 3px; }
.auth-scroll::-webkit-scrollbar-thumb:hover { background: #B9BFC9; }
@supports (-moz-appearance: none) {
    .auth-scroll { scrollbar-width: thin; scrollbar-color: #D5D9E0 transparent; }
}

.auth-footer { flex: none; }
.auth-footer .auth-btn { margin-top: 32px; }

/* User sign up: the fields box has a fixed height, so every screen shows the same
   fields, down to the City and Zip labels and the top edge of their inputs (Figma).
   A shorter window shows the card a little smaller instead of fewer fields (each step
   fits from 32px + 882px x zoom tall); below 694px tall the page also scrolls. */
.auth-shell--fixed {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    justify-content: center;
    padding-top: 16px;
    padding-bottom: 16px;
}
.auth-shell--fixed .auth-scroll { flex: none; height: 543px; }

@media (min-width: 601px) and (min-height: 561px) and (max-height: 913.98px) { .auth-shell--fixed > * { zoom: 0.95; } }
@media (min-width: 601px) and (min-height: 561px) and (max-height: 869.98px) { .auth-shell--fixed > * { zoom: 0.9; } }
@media (min-width: 601px) and (min-height: 561px) and (max-height: 825.98px) { .auth-shell--fixed > * { zoom: 0.85; } }
@media (min-width: 601px) and (min-height: 561px) and (max-height: 781.98px) { .auth-shell--fixed > * { zoom: 0.8; } }
@media (min-width: 601px) and (min-height: 561px) and (max-height: 737.98px) { .auth-shell--fixed > * { zoom: 0.75; } }

/* Organization sign up: down to EIN Number, the box cutting through the first tick
   box's line (Figma). Its card is taller, so its steps start higher (32px + 976px x
   zoom); the two-class selectors win over the user page's steps above. */
.auth-shell--fixed.auth-shell--org .auth-scroll { height: 637px; }

@media (min-width: 601px) and (min-height: 561px) and (max-height: 1007.98px) { .auth-shell--fixed.auth-shell--org > * { zoom: 0.95; } }
@media (min-width: 601px) and (min-height: 561px) and (max-height: 959.98px) { .auth-shell--fixed.auth-shell--org > * { zoom: 0.9; } }
@media (min-width: 601px) and (min-height: 561px) and (max-height: 910.98px) { .auth-shell--fixed.auth-shell--org > * { zoom: 0.85; } }
@media (min-width: 601px) and (min-height: 561px) and (max-height: 861.98px) { .auth-shell--fixed.auth-shell--org > * { zoom: 0.8; } }
@media (min-width: 601px) and (min-height: 561px) and (max-height: 812.98px) { .auth-shell--fixed.auth-shell--org > * { zoom: 0.75; } }

/* Organization sign up at the Figma Dev Mode sizes. The page is no longer zoomed
   down on shorter windows (that shrank every box); the fields box gets shorter instead. */
.auth-shell--org .auth-card { max-width: 883px; border-radius: 24px; }
.auth-shell--org .auth-title { font-size: 24px; }
.auth-shell--org .auth-form { margin-top: 28px; }
.auth-shell--org .auth-options { margin: 0 0 16px; }
.auth-shell--org .auth-option__box { padding: 12px 16px; border: 1px solid #D0D5DD; border-radius: 16px; }
.auth-shell--org .auth-option input:checked + .auth-option__box { border-color: #4994C9; background: #EFF8FF; }
.auth-shell--org .auth-option__title { margin-top: 10px; font-size: 16px; line-height: 24px; color: #121212; }
.auth-shell--org .auth-option__desc { font-size: 12px; line-height: 18px; color: #535353; }
.auth-shell--org .auth-grid { column-gap: 12px; row-gap: 12px; }
.auth-shell--org .auth-label { margin-bottom: 6px; font-size: 12px; color: #121212; }
.auth-shell--org .auth-input { padding: 12px 14px; border: 1px solid #D0D5DD; font-size: 14px; }
.auth-shell--org .auth-input:focus { border-color: var(--auth-link); }
.auth-shell--org .auth-input.error { border-color: var(--auth-error); }
.auth-shell--org .auth-input:-webkit-autofill::first-line { font-size: 14px; }
.auth-shell--org .auth-checks { row-gap: 8px; }
.auth-shell--org .auth-footer .auth-btn { margin-top: 24px; padding: 16px; border-radius: 24px; font-size: 16px; line-height: 26px; }
.auth-shell--org .auth-switch { margin-top: 12px; font-size: 14px; font-weight: 500; color: #121212; }
.auth-shell--org .auth-switch .auth-link { font-size: 14px; }
@media (min-width: 601px) and (min-height: 561px) {
    .auth-shell--fixed > *,
    .auth-shell--fixed.auth-shell--org > * { zoom: 1; }
    .auth-shell--fixed .auth-scroll { height: clamp(220px, calc(100vh - 379px), 543px); height: clamp(220px, calc(100dvh - 379px), 543px); }
    .auth-shell--fixed.auth-shell--org .auth-scroll { height: clamp(220px, calc(100vh - 379px), 637px); height: clamp(220px, calc(100dvh - 379px), 637px); }
}

/* Phones and very short windows: the page scrolls as a whole instead. */
@media (max-width: 600px), (max-height: 560px) {
    .auth-shell--scroll { height: auto; min-height: 100vh; }
    .auth-card--scroll,
    .auth-card--scroll .auth-form { display: block; }
    .auth-scroll,
    .auth-shell--fixed .auth-scroll,
    .auth-shell--fixed.auth-shell--org .auth-scroll { height: auto; overflow: visible; margin: 0; padding: 0; scrollbar-gutter: auto; }
    .auth-shell--fixed { justify-content: flex-start; }
}

/* ---- Organization forgot password ---------------------------------------

   Its own Figma frames (600px card): smaller type than sign in, a 24px card
   corner, a 5px field corner and a darker blue button. Scoped to .auth-recover
   so the other auth screens keep their sizes. */

.auth-recover { padding: 40px; border-radius: 24px; }
.auth-recover .auth-title { font-size: 24px; line-height: 36px; }
.auth-recover .auth-form { margin-top: 32px; }
.auth-recover .auth-label { margin-bottom: 6px; font-size: 12px; line-height: 18px; }
.auth-recover .auth-input { padding: 0 13px; border-radius: 5px; font-size: 14px; }
.auth-recover .auth-input:-webkit-autofill::first-line { font-size: 14px; }
.auth-recover .auth-input--invalid { border-color: #EF0003; background-color: #FFF7F7; }
.auth-recover .auth-input--invalid:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #FFF7F7 inset;
    box-shadow: 0 0 0 1000px #FFF7F7 inset;
}
.auth-recover__error { margin: 12px 0 0; font-size: 14px; line-height: 21px; color: #C60001; }

.auth-recover .auth-btn { margin-top: 32px; border-radius: 24px; font-size: 16px; background: #004CA5; }
.auth-recover .auth-btn:hover { background: #00428F; }
.auth-recover .auth-btn:active { background: #003A7E; }

.auth-recover .auth-switch { margin-top: 12px; font-size: 14px; line-height: 21px; }
.auth-recover__back { color: var(--auth-text); font-weight: 500; text-decoration: none; }
.auth-recover__back:hover { text-decoration: underline; }
.auth-recover__back:focus-visible { outline: 2px solid var(--auth-link); outline-offset: 2px; border-radius: 2px; }

/* "Check Your Inbox", shown once the reset link is sent. */
.auth-recover--sent { text-align: center; }
.auth-recover__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 50%;
    background: #D7EFFF;
    color: #004CA5;
}
.auth-recover__icon svg { display: block; }
.auth-recover--sent .auth-title { margin-top: 29px; }
.auth-recover__text {
    max-width: 480px;
    margin: 7px auto 0;
    font-size: 14px;
    line-height: 21px;
    color: #6B7072;
    overflow-wrap: anywhere;
}
.auth-recover .auth-recover__resend {
    margin-top: 40px;
    background: #FFFFFF;
    color: var(--auth-text);
    font-weight: 400;
    box-shadow: inset 0 0 0 1px #0066B0;
}
.auth-recover .auth-recover__resend:hover { background: #F2F7FC; }
.auth-recover .auth-recover__resend:active { background: #E6EFF8; }

/* ---- Small screens ----------------------------------------------------- */

@media (max-width: 600px) {
    .auth-shell { padding: 40px 16px; }
    .auth-shell--center { justify-content: flex-start; }
    .auth-card { margin-top: 24px; padding: 24px 18px; border-radius: 14px; }
    .auth-grid { grid-template-columns: minmax(0, 1fr); row-gap: 10px; }
    .auth-grid__spacer { display: none; }
    .auth-section-title { margin-top: 8px; }
    .auth-btn--signin { margin-top: 32px; }
    /* 14px on phones; maximum-scale=1 in _auth_head.html stops iOS Safari zooming the
       page when a field under 16px gets focus. */
    .auth-input { font-size: 14px; }
    .auth-input:-webkit-autofill::first-line { font-size: 14px; }
    .auth-shell--org .auth-input,
    .auth-shell--org .auth-input:-webkit-autofill::first-line { font-size: 14px; }
    .auth-recover .auth-input,
    .auth-recover .auth-input:-webkit-autofill::first-line { font-size: 14px; }
}

@media (max-width: 380px) {
    .auth-options { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-input, .auth-btn { transition: none; }
}
