/*
 * Sign-up, one question per screen.
 *
 * The markup is a single form carrying every question. The script turns it into
 * a stepper by setting data-stepper="on"; everything below that depends on the
 * stepper is scoped to that attribute, so with JavaScript off the page stays a
 * plain form with all the questions on it and nothing hidden.
 */

.signup-card {
    max-width: 32rem;
}

.signup-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.signup-count {
    margin: 0;
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(240, 234, 214, .55);
    font-variant-numeric: tabular-nums;
}

.signup-track {
    height: 3px;
    background: rgba(240, 234, 214, .14);
    border-radius: 2px;
    overflow: hidden;
}

.signup-track > span {
    display: block;
    height: 100%;
    width: 0;
    background: #d9a03f;
}

@media (prefers-reduced-motion: no-preference) {
    .signup-track > span { transition: width .32s cubic-bezier(.4, 0, .2, 1); }
}

.signup-summary {
    background: #fee2e2;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* A fieldset would otherwise bring its own border, padding and width rules. */
.signup-step {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.signup-q {
    padding: 0;
    margin: 0 0 2px;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 600;
    /* The auth card sits on the dark hero, so this follows .auth-title rather
       than the light-page defaults the rest of the site uses. */
    color: var(--brand-cream, #f0ead6);
    font-family: var(--font-serif);
}

.signup-sub {
    margin: 0 0 4px;
    font-size: 13.5px;
    line-height: 1.5;
    color: rgba(240, 234, 214, .7);
}

.signup-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 30rem) {
    .signup-pair { grid-template-columns: 1fr; }
}

.signup-error {
    margin: 0;
    min-height: 1.15rem;
    font-size: 13px;
    color: #ffb4b4;
}

.signup-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.signup-actions .auth-submit-btn {
    margin: 0;
    flex: 1;
}

.signup-back {
    background: none;
    border: 0;
    padding: 10px 6px;
    font: inherit;
    font-size: 14px;
    color: rgba(240, 234, 214, .7);
    cursor: pointer;
}

.signup-back:hover { color: var(--brand-cream, #f0ead6); }
.signup-back:focus-visible,
.signup-form :focus-visible { outline: 2px solid #d9a03f; outline-offset: 2px; }

/* --- only once the script has taken over ------------------------------- */

.signup-form[data-stepper="on"] .signup-step { display: none; }
.signup-form[data-stepper="on"] .signup-step.is-current { display: flex; }

/* One question from the first paint.
 *
 * data-stepper is set by the script, which cannot run until the document has
 * been parsed — so for a moment the page showed every question at once and then
 * visibly collapsed to one. The class below is put on <html> by a line in the
 * head, before any of this is drawn, so the first question is the only thing
 * ever painted.
 *
 * The first step stays visible rather than hiding everything: if the script
 * fails to arrive, a form open on question one is a far better failure than a
 * card with nothing in it. */
html.js-stepper .signup-form:not([data-stepper="on"]) .signup-step { display: none; }
html.js-stepper .signup-form:not([data-stepper="on"]) .signup-step:first-of-type { display: flex; }

@media (prefers-reduced-motion: no-preference) {
    .signup-form[data-stepper="on"] .signup-step.is-current {
        animation: signup-rise .3s cubic-bezier(.2, .7, .3, 1) backwards;
    }
    @keyframes signup-rise {
        from { opacity: 0; transform: translateY(8px); }
    }
}

/* The field that failed, marked as the reader is looking at it. */
.signup-form .input-field.has-error {
    border-color: #b91c1c;
}

/* --- dropdowns -------------------------------------------------------------
 *
 * The three pickers are SlimSelect, the same control the author modal and the
 * profile use — a native <select> renders the operating system's own list,
 * which on this page dropped a light grey panel over the dark card and had no
 * way to search 68 specialties or 250 countries.
 *
 * SlimSelect is themed entirely through its own custom properties, so the dark
 * treatment is a variable block rather than a pile of overrides fighting its
 * stylesheet.
 *
 * On :root rather than on the form, because SlimSelect appends its open panel
 * to <body> — outside the form entirely — so anything scoped to .signup-form
 * reaches the closed control and none of the list. That is what left the
 * highlighted row on SlimSelect's default blue. This file is only loaded on
 * the sign-up page, so :root here is that page and nothing else.
 */
:root {
    --ss-primary-color: #d9a03f;
    --ss-bg-color: #16283d;
    --ss-font-color: #f0ead6;
    --ss-font-placeholder-color: rgba(240, 234, 214, .5);
    --ss-disabled-color: #2a3f58;
    --ss-border-color: rgba(240, 234, 214, .22);
    --ss-highlight-color: #d9a03f;
    --ss-success-color: #3f7d5a;
    --ss-error-color: #b91c1c;
    --ss-focus-color: #d9a03f;
    --ss-main-height: 44px;
    /* SlimSelect transitions the panel from transform:scaleY(0) to scaleY(1).
       The lift below replaces that transform, so the panel animated from
       un-lifted-and-flat up into place — the options visibly slid before
       settling. Its transition is switched off and replaced with one that
       carries the lift the whole way. */
    --ss-animation-timing: 0s;
    --ss-content-height: 18rem;
    --ss-border-radius: 6px;

    --ss-clear-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 3.5l9 9M12.5 3.5l-9 9' stroke='%23000' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
}

/* A select that SlimSelect has taken over is hidden by it; the label above is
   the only one, so it is a plain label rather than a floating one. */
.signup-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.signup-label {
    font-size: 11.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(240, 234, 214, .55);
}

.signup-form .ss-main {
    background-color: rgba(255, 255, 255, .05);
    /* The value sets its own inset below, so the control does not add one on
       top — the closed label and the open search box have to start at the same
       x, or opening the picker looks like the text jumps sideways. */
    padding-left: 0;
}

/* 14px: the same inset the search input uses, measured to land the closed
   label and the open search text on the same pixel. */
.signup-form .ss-main .ss-values .ss-placeholder,
.signup-form .ss-main .ss-values .ss-single {
    padding-left: 14px;
    margin-left: 0;
}

.signup-form .ss-main:focus,
.signup-form .ss-main.ss-open-below,
.signup-form .ss-main.ss-open-above {
    border-color: #d9a03f;
    box-shadow: none;
}

/* The panel floats out of the card, so it needs its own ground rather than
   inheriting the card's translucency and showing the page through itself. */
.ss-content {
    background-color: #16283d;
    border-color: rgba(240, 234, 214, .22);
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .75);
    overflow: hidden;
}

/* --- typing happens in the control, not in a box below it ---------------
 *
 * SlimSelect puts its search in the panel, so an open picker read as two
 * stacked fields: the control, then a second bordered box under it. The panel
 * is joined to the control instead — no gap, no second border, square where
 * they meet — so the thing you type into is the field you clicked.
 */
.ss-main.ss-open-below { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.ss-main.ss-open-above { border-top-left-radius: 0; border-top-right-radius: 0; }

/* The panel is absolutely positioned against the control's bottom edge, so
   pulling it up by exactly the control's height lands the search on top of the
   control: same box, same width, opaque, covering it. The list then starts
   where the panel used to. One field you click and type into, options beneath.

   Done with a transform, not a margin: SlimSelect writes `margin` into the
   element's own style attribute when it positions the panel, and an inline
   style wins over a stylesheet. It sets no transform, so this is left alone.

   This only lines up opening downwards, which is why the two pickers built on
   this page pin openPosition to 'down'. */
.ss-content.ss-open-below {
    transform: translateY(calc(-1 * var(--ss-main-height)));
    border-radius: var(--ss-border-radius);
    border-color: #d9a03f;
    animation: ss-panel-drop .16s ease-out;
    /* SlimSelect pads the panel; that padding would push the search down off
       the control it is supposed to be covering. The list gets it back below. */
    padding: 0;
}
.ss-content.ss-open-above { margin-bottom: -1px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

.ss-content .ss-search {
    padding: 0;
    border-bottom: 1px solid rgba(240, 234, 214, .14);
}

.ss-content .ss-search input {
    height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    color: #f0ead6;
    font-size: 15px;
}

/* Opaque and the control's own height: this is the box now sitting over the
   closed control, not a strip inside a panel. */
.ss-content.ss-open-below .ss-search input {
    height: calc(var(--ss-main-height) - 2px);
    background-color: #16283d;
    font-size: 16px;
}

.ss-content.ss-open-below .ss-list { padding: 4px 0; }

.ss-content .ss-search input:focus { box-shadow: none; outline: 0; }
.ss-content .ss-search input::placeholder { color: rgba(240, 234, 214, .45); }

.ss-content .ss-list { padding: 4px 0; }

.ss-content .ss-list .ss-option {
    color: rgba(240, 234, 214, .85);
    padding: 9px 14px;
}

.ss-content .ss-list .ss-option:hover,
.ss-content .ss-list .ss-option.ss-highlighted { background-color: rgba(217, 160, 63, .22); color: #f0ead6; }
.ss-content .ss-list .ss-option.ss-selected { background-color: #d9a03f; color: #10192a; }
.ss-content .ss-list .ss-option.ss-disabled { color: rgba(240, 234, 214, .4); background-color: transparent; }

/* The list is the only thing that scrolls, and the platform's own bar is a
   white slab on a navy panel. */
/* --- nothing matched -------------------------------------------------------
 *
 * SlimSelect renders the empty state as a .ss-search inside the list, which is
 * the same class as the search row — so the rule that strips the search row's
 * padding was flattening this against the left edge too. It is addressed as
 * what it is: the list's own message.
 */
.ss-content .ss-list > .ss-search {
    display: block;
    padding: 22px 16px 26px;
    text-align: center;
    color: rgba(240, 234, 214, .55);
    font-size: 14px;
    border-bottom: 0;
}

/* Chrome draws its own clear button on a search input, in its own blue. */
.ss-content .ss-search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    height: 15px;
    width: 15px;
    margin-left: 8px;
    cursor: pointer;
    background-color: rgba(240, 234, 214, .55);
    -webkit-mask-image: var(--ss-clear-icon);
    mask-image: var(--ss-clear-icon);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.ss-content .ss-search input::-webkit-search-cancel-button:hover {
    background-color: var(--brand-cream, #f0ead6);
}

/* The lift is in both ends of the keyframes, so the panel only ever grows
   into place — it never travels. */
@keyframes ss-panel-drop {
    from {
        opacity: 0;
        transform: translateY(calc(-1 * var(--ss-main-height))) scaleY(.97);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ss-content.ss-open-below { animation: none; }
}

/* Firefox only. Chrome supports both syntaxes but prefers this one wherever it
   is present — and setting it there switches off every ::-webkit-scrollbar rule
   below, which is what left the stepper arrows on the panel. */
@supports not selector(::-webkit-scrollbar) {
    .ss-content .ss-list {
        scrollbar-width: thin;
        scrollbar-color: rgba(240, 234, 214, .3) transparent;
    }
}

.ss-content .ss-list::-webkit-scrollbar { width: 8px; }
.ss-content .ss-list::-webkit-scrollbar-track { background: transparent; }

/* Windows draws stepper arrows at both ends by default; they are two more
   light stubs on a dark panel and nobody clicks them. */
.ss-content .ss-list::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
.ss-content .ss-list::-webkit-scrollbar-corner { background: transparent; }

.ss-content .ss-list::-webkit-scrollbar-thumb {
    background-color: rgba(240, 234, 214, .22);
    border-radius: 99px;
    /* Inset from the panel edge, so the bar reads as part of the list rather
       than a rail bolted to the side of it. */
    border: 2px solid transparent;
    background-clip: content-box;
}

.ss-content .ss-list::-webkit-scrollbar-thumb:hover { background-color: rgba(240, 234, 214, .38); }

/* Says the country was filled in by us rather than by the reader. Quiet, but
   present: a silently pre-filled field is one nobody checks. */
.signup-guessed {
    display: block;
    margin-top: 4px;
    color: rgba(240, 234, 214, .55);
}

/* Affiliation suggestions moved to /css/components/suggest.css when the
   submission wizard's author modal needed the same control. The colours
   here became that file's defaults, so this page is unchanged. */
