/* Sign-up in three steps (central/sign-up/form.blade.php), in the sign-in page's design:
   css/auth.css gives the frame, the fields and the buttons; this adds the steps, the address,
   the plans and the motion. Its own colours are auth.css's variables, so light and dark follow.
   Motion: sign-up.js moves the panes with the curves below; reduced motion keeps fades only. */

.su-flow {
    --su-ease: cubic-bezier(0.23, 1, 0.32, 1);
    --su-ease-move: cubic-bezier(0.77, 0, 0.175, 1);
    --su-tint: rgba(97, 206, 112, 0.07);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
}

.su-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ── The steps: three dots joined by lines that fill as each step is done ── */
.su-steps ol {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.su-step {
    display: flex;
    flex: 1;
    align-items: center;
    min-width: 0;
}

.su-step:first-child {
    flex: none;
}

.su-step__line {
    flex: 1;
    height: 2px;
    margin-inline: 10px;
    overflow: hidden;
    border-radius: 2px;
    background: var(--auth-border-strong);
}

.su-step__fill {
    display: block;
    height: 100%;
    background: var(--auth-btn-bg);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 420ms var(--su-ease-move);
}

[dir="rtl"] .su-step__fill {
    transform-origin: right center;
}

.su-step.is-done .su-step__fill,
.su-step.is-current .su-step__fill {
    transform: scaleX(1);
}

.su-step__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    border-radius: 999px;
    color: var(--auth-muted);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
}

.su-step__link[aria-disabled="true"] {
    pointer-events: none;
}

.su-step__link:focus-visible {
    outline: none;
    box-shadow: var(--auth-focus);
}

.su-step.is-current .su-step__link,
.su-step.is-done .su-step__link {
    color: var(--auth-text);
}

.su-step__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.su-step__dot {
    position: relative;
    display: grid;
    flex: none;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--auth-border-strong);
    border-radius: 50%;
    background: var(--auth-card);
    color: var(--auth-muted);
    font-size: 0.8rem;
    font-weight: 600;
    transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

.su-step.is-current .su-step__dot {
    border-color: var(--auth-accent);
    box-shadow: var(--auth-focus);
    color: var(--auth-text);
}

/* Done: the brand green with navy (8.38:1), the number giving way to a check that draws */
.su-step.is-done .su-step__dot {
    border-color: var(--auth-btn-bg);
    background: var(--auth-btn-bg);
    color: var(--auth-btn-fg);
}

.su-step__num {
    transition: opacity 150ms ease, transform 150ms var(--su-ease);
}

.su-step.is-done .su-step__num {
    opacity: 0;
    transform: scale(0.6);
}

.su-step__check {
    position: absolute;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    transition: stroke-dashoffset 360ms var(--su-ease) 120ms;
}

.su-step.is-done .su-step__check {
    stroke-dashoffset: 0;
}

@media (hover: hover) and (pointer: fine) {
    .su-step.is-done .su-step__link:hover .su-step__label {
        text-decoration: underline;
    }
}

/* ── The panes ── */
.su-stage {
    position: relative;
}

.su-pane {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.su-pane[hidden] {
    display: none;
}

/* The pane going away, while the next comes in (sign-up.js) */
.su-pane.is-leaving {
    position: absolute;
    inset: 0 0 auto;
    pointer-events: none;
}

.su-head .panel-title:focus {
    outline: none;
}

/* The plan a pricing link chose, carried from step 1 */
.su-picked {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -6px 0 0;
    color: var(--auth-muted);
    font-size: 0.85rem;
}

.su-picked strong {
    color: var(--auth-text);
    font-weight: 600;
}

.su-picked svg {
    flex: none;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--auth-accent);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.su-flow[data-step="plan"] .su-picked {
    display: none;
}

/* ── Fields: a hint, an error ── */
.su-hint,
.su-error {
    margin: -2px 0 0;
    font-size: 0.8rem;
    line-height: 1.45;
}

.su-hint {
    color: var(--auth-muted);
}

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

.su-hint[hidden],
.su-error[hidden] {
    display: none;
}

.su-field-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-self: start;
    margin-top: -2px;
    font-size: 0.85rem;
    font-weight: 600;
}

.su-field-link[hidden] {
    display: none;
}

.su-field-link svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 160ms var(--su-ease);
}

[dir="rtl"] .su-field-link svg {
    transform: scaleX(-1);
}

@media (hover: hover) and (pointer: fine) {
    .su-field-link:hover svg {
        transform: translateX(3px);
    }

    [dir="rtl"] .su-field-link:hover svg {
        transform: scaleX(-1) translateX(3px);
    }
}

.auth-page .input-shell.is-invalid {
    border-color: var(--auth-danger-text);
}

.auth-page .input-shell.is-invalid:focus-within {
    box-shadow: 0 0 0 3px var(--auth-danger-bg);
}

/* ── The store's address: the name, the domain, and whether it's free ── */
.auth-page .su-address {
    direction: ltr;
}

.su-address__suffix {
    flex: none;
    color: var(--auth-muted);
    font-size: 0.95rem;
    white-space: nowrap;
}

.su-address__state {
    position: relative;
    display: grid;
    flex: none;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-inline-end: 8px;
}

.su-address__state > * {
    position: absolute;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 150ms ease, transform 200ms var(--su-ease);
}

.su-address__spin {
    width: 16px;
    height: 16px;
    border: 2px solid var(--auth-muted);
    border-top-color: transparent;
    border-radius: 50%;
    animation: auth-spin 0.65s linear infinite;
}

.su-address__ok,
.su-address__no {
    width: 18px;
    height: 18px;
    fill: none;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.su-address__ok {
    stroke: var(--auth-accent);
}

.su-address__no {
    stroke: var(--auth-danger-text);
}

.su-address[data-su-address="checking"] .su-address__spin,
.su-address[data-su-address="ok"] .su-address__ok,
.su-address[data-su-address="taken"] .su-address__no {
    opacity: 1;
    transform: scale(1);
}

.su-hint.is-ok {
    color: var(--auth-accent);
    font-weight: 500;
}

/* ── Buttons: Back beside Continue ── */
.su-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.su-actions .auth-btn {
    flex: 1;
}

.su-back {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 6px;
    height: 52px;
    padding: 0 20px 0 14px;
    border: 1px solid var(--auth-border-strong);
    border-radius: 999px;
    background: var(--auth-card);
    color: var(--auth-text);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 150ms ease;
}

.su-back svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

[dir="rtl"] .su-back {
    padding: 0 14px 0 20px;
}

[dir="rtl"] .su-back svg {
    transform: scaleX(-1);
}

.su-back:focus-visible {
    outline: none;
    box-shadow: var(--auth-focus);
}

@media (hover: hover) and (pointer: fine) {
    .su-back:hover {
        border-color: var(--auth-accent);
    }
}

.auth-page a.auth-btn {
    text-decoration: none;
}

.auth-page .auth-btn:active,
.su-back:active {
    transform: scale(0.98);
    transition: transform 100ms ease;
}

/* ── Google's account, once chosen ── */
.su-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--auth-border-strong);
    border-radius: 18px;
    background: var(--auth-input);
}

.su-identity__mark {
    display: grid;
    flex: none;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--auth-border);
    border-radius: 50%;
    background: #fff;
}

.su-identity__mark svg {
    width: 20px;
    height: 20px;
}

.su-identity__who {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.su-identity__who strong {
    color: var(--auth-text);
    font-weight: 600;
}

.su-identity__who span {
    overflow: hidden;
    color: var(--auth-muted);
    font-size: 0.88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.su-restart {
    margin: 0;
    text-align: center;
}

.su-linkbtn {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ── The plans ── */
.su-pane--plan .lp-bar {
    justify-content: flex-start;
    margin: 0;
    font-size: 0.8rem;
    text-align: start;
    color: var(--auth-muted);
}

/* Monthly or yearly: a thumb that slides under the chosen one */
.su-cycle {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    justify-self: start;
    padding: 4px;
    border: 1px solid var(--auth-border-strong);
    border-radius: 999px;
    background: var(--auth-input);
}

.su-cycle__thumb {
    position: absolute;
    top: 4px;
    bottom: 4px;
    inset-inline-start: 4px;
    width: calc(50% - 4px);
    border-radius: 999px;
    background: var(--auth-card);
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.14);
    transition: transform 260ms var(--su-ease);
}

/* Dark: the card's colour is too close to the track's; the strong border colour stands out */
html.auth-dark .su-cycle__thumb {
    background: var(--auth-border-strong);
    box-shadow: none;
}

.su-cycle:has(input[value="yearly"]:checked) .su-cycle__thumb {
    transform: translateX(100%);
}

[dir="rtl"] .su-cycle:has(input[value="yearly"]:checked) .su-cycle__thumb {
    transform: translateX(-100%);
}

.su-cycle__opt {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    color: var(--auth-muted);
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: color 200ms ease;
}

.su-cycle__opt input,
.su-plan__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.su-cycle__opt:has(input:checked) {
    color: var(--auth-text);
}

.su-cycle__opt:has(input:focus-visible) {
    box-shadow: var(--auth-focus);
}

.su-cycle__save {
    color: var(--auth-accent);
    font-size: 0.74rem;
    font-weight: 600;
}

.su-plans {
    display: grid;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.su-plan {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--auth-border-strong);
    border-radius: 18px;
    background: var(--auth-card);
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease, transform 100ms ease;
}

.su-plan:has(.su-plan__input:checked) {
    border-color: var(--auth-accent);
    background: var(--su-tint);
    box-shadow: 0 0 0 1px var(--auth-accent);
}

.su-plan:has(.su-plan__input:focus-visible) {
    box-shadow: 0 0 0 1px var(--auth-accent), var(--auth-focus);
}

.su-plan:active {
    transform: scale(0.99);
}

@media (hover: hover) and (pointer: fine) {
    .su-plan:hover {
        border-color: var(--auth-accent);
    }
}

.su-plan__radio {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--auth-border-strong);
    border-radius: 50%;
    background: var(--auth-card);
    transition: border-color 160ms ease;
}

.su-plan__radio::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--auth-accent);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 150ms ease, transform 200ms var(--su-ease);
}

.su-plan:has(.su-plan__input:checked) .su-plan__radio {
    border-color: var(--auth-accent);
}

.su-plan:has(.su-plan__input:checked) .su-plan__radio::after {
    opacity: 1;
    transform: scale(1);
}

.su-plan__body {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.su-plan__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

.su-plan__name {
    color: var(--auth-text);
    font-size: 0.98rem;
    font-weight: 600;
}

/* The trial: navy on the brand green, 8.38:1 */
.su-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--auth-btn-bg);
    color: var(--auth-btn-fg);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.su-plan__meta {
    overflow: hidden;
    color: var(--auth-muted);
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.su-plan__price {
    text-align: end;
    white-space: nowrap;
}

.su-plan__cost[hidden] {
    display: none;
}

.su-plan__amount {
    color: var(--auth-text);
    font-size: 1.05rem;
    font-weight: 600;
}

.su-plan__per {
    margin-inline-start: 2px;
    color: var(--auth-muted);
    font-size: 0.8rem;
}

.su-note {
    margin: -4px 0 0;
    color: var(--auth-muted);
    font-size: 0.85rem;
}

.su-terms {
    margin: 0;
    color: var(--auth-muted);
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: center;
}

.su-terms .auth-link {
    font-size: inherit;
}

.su-empty {
    margin: 0;
    color: var(--auth-muted);
}

/* Phones: a plan's price goes under its name, so a trial's badge and a long local price both fit */
@media (max-width: 420px) {
    .su-plan {
        grid-template-columns: auto minmax(0, 1fr);
        row-gap: 6px;
    }

    .su-plan__price {
        grid-column: 2;
        text-align: start;
    }
}

/* Phones: the labels of the steps not being filled in give way first */
@media (max-width: 380px) {
    .su-step:not(.is-current) .su-step__label {
        display: none;
    }

    .su-back {
        padding: 0 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .su-step__fill,
    .su-step__num,
    .su-step__check,
    .su-cycle__thumb,
    .su-address__state > *,
    .su-plan__radio::after {
        transition-duration: 0.01ms;
        transition-delay: 0s;
    }

    .su-plan:active,
    .auth-page .auth-btn:active,
    .su-back:active {
        transform: none;
    }
}
