/* Signup page shell and shared form styling. The location controls remain in
   signup_location.css so the map can be loaded only on the final step. */
:root {
    --signup-ink: #24211e;
    --signup-muted: #716b64;
    --signup-soft: #fffdf9;
    --signup-paper: #fffdf9;
    --signup-line: #e8dfd5;
    --signup-orange: #e75b12;
    --signup-orange-dark: #bb3f0a;
    --signup-orange-soft: #fff0e5;
    --signup-danger: #b42318;
    --signup-radius: 20px;
}

html,
body {
    min-height: 100%;
}

body {
    background: var(--signup-soft);
    color: var(--signup-ink);
    font-family: var(--app-font-family);
    margin: 0;
}

.signup-page {
    background: var(--signup-soft);
    display: grid;
    direction: ltr;
    grid-template-columns: minmax(300px, 44fr) minmax(420px, 56fr);
    min-height: 100dvh;
    padding: 16px;
}

.signup-visual {
    background: #f3e8da;
    border-radius: 24px;
    align-self: start;
    grid-column: 1;
    grid-row: 1;
    height: calc(100dvh - 32px);
    overflow: hidden;
    position: sticky;
    top: 16px;
}

.signup-visual-inner {
    color: #3e281b;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: flex-start;
    padding: clamp(22px, 2.5vw, 36px);
    position: relative;
    z-index: 2;
}

.signup-visual-brand {
    align-items: center;
    display: inline-flex;
    width: fit-content;
}

.signup-visual-brand img {
    height: auto;
    max-width: 138px;
    width: 138px;
}

.signup-visual-copy {
    margin-top: 24px;
    max-width: 430px;
}

.signup-visual-kicker {
    color: #a13c0b;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0 0 12px;
}

.signup-visual-title {
    color: #3e281b;
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0;
    text-wrap: balance;
}

.signup-visual-description {
    color: #5f4838;
    font-size: 16px;
    line-height: 1.8;
    margin: 18px 0 0;
    max-width: 36ch;
}

.signup-retail-grid {
    display: grid;
    direction: ltr;
    flex: 1;
    gap: 12px;
    grid-template-columns: 1.1fr 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    margin-top: 24px;
    min-height: 0;
}

.signup-retail-grid img {
    border-radius: 16px;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: center;
    width: 100%;
}

.signup-retail-primary {
    grid-row: span 2;
}

@media (min-width: 901px) and (max-height: 760px) {
    .signup-visual-copy { margin-top: 18px; }
    .signup-visual-title { font-size: 30px; }
    .signup-visual-description { display: none; }
    .signup-retail-grid { margin-top: 20px; }
}

.signup-content {
    direction: ltr;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

.signup-content-inner {
    margin: 0 auto;
    max-width: 680px;
    padding: clamp(24px, 5vw, 64px) clamp(20px, 4vw, 56px);
}

@media (min-width: 901px) {
    .signup-page[data-step="phone"] .signup-content-inner,
    .signup-page[data-step="otp"] .signup-content-inner {
        display: flex;
        flex-direction: column;
        min-height: calc(100dvh - 32px);
    }

    .signup-page[data-step="phone"] .auth-panel,
    .signup-page[data-step="otp"] .auth-panel {
        margin-block: auto;
        padding-block: 32px;
    }
}

.signup-topbar {
    align-items: center;
    display: flex;
    justify-content: flex-end;
    min-height: 32px;
}

.signup-topbar-prompt,
.footer-link {
    color: var(--signup-muted);
    font-size: 13px;
    line-height: 1.7;
}

.signup-topbar-prompt a,
.footer-link a {
    color: var(--signup-orange-dark);
    font-weight: 800;
    text-decoration: none;
}

.signup-topbar-prompt a:hover,
.signup-topbar-prompt a:focus-visible,
.footer-link a:hover,
.footer-link a:focus-visible {
    color: var(--signup-orange);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-panel {
    max-width: 540px;
    margin-top: 28px;
}

.auth-header {
    margin-bottom: 25px;
}

.logo {
    display: none;
}

.eyebrow {
    color: var(--signup-orange-dark);
    font-size: 13px;
    font-weight: 800;
    margin: 0 0 8px;
}

.title {
    color: var(--signup-ink);
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 0;
}

.subtitle {
    color: var(--signup-muted);
    font-size: 15px;
    line-height: 1.8;
    margin: 10px 0 0;
    max-width: 42ch;
}

.step-list {
    align-items: flex-start;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
    position: relative;
}

.step-list::before {
    background: var(--signup-line);
    content: "";
    height: 1px;
    left: 12%;
    position: absolute;
    right: 12%;
    top: 16px;
}

.step-item {
    align-items: center;
    color: #9b948d;
    display: flex;
    flex-direction: column;
    font-size: 11px;
    font-weight: 700;
    gap: 7px;
    line-height: 1.4;
    position: relative;
    text-align: center;
    z-index: 1;
}

.step-item.active,
.step-item[aria-current="step"] {
    color: var(--signup-orange-dark);
}

.step-item-number {
    align-items: center;
    background: var(--signup-paper);
    border: 1px solid var(--signup-line);
    border-radius: 50%;
    display: inline-flex;
    font-size: 12px;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.step-item.active .step-item-number,
.step-item[aria-current="step"] .step-item-number {
    background: var(--signup-orange-soft);
    border-color: #f3a36f;
    color: var(--signup-orange-dark);
}

.step-item.is-complete .step-item-number {
    background: var(--signup-orange);
    border-color: var(--signup-orange);
    color: #ffffff;
}

.signup-field-group {
    border: 0;
    margin: 0 0 24px;
    min-width: 0;
    padding: 0;
}

.signup-field-group legend {
    border-bottom: 1px solid var(--signup-line);
    color: var(--signup-ink);
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 18px;
    padding: 0 0 12px;
    width: 100%;
}

.signup-field-group .field:last-child { margin-bottom: 0; }

.signup-referral-field {
    background: #f8f5f0;
    border: 1px solid var(--signup-line);
    border-radius: 14px;
    padding: 16px;
}

.signup-optional {
    color: var(--signup-muted);
    font-size: 12px;
    font-weight: 400;
    margin-inline-start: 8px;
}

.field.field-has-error input,
.field.field-has-error select { border-color: var(--signup-danger); }

.help-text ul {
    list-style: disc;
    padding-inline-start: 18px;
}

.help-text li + li { margin-top: 3px; }

.field {
    margin-bottom: 19px;
}

.field label {
    color: #403a35;
    display: block;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 8px;
}

.field input,
.field select {
    background: #ffffff;
    border: 1px solid #d7cec5;
    border-radius: 12px;
    color: var(--signup-ink);
    font-size: 16px;
    min-height: 52px;
    outline: none;
    padding: 13px 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    width: 100%;
}

.field input::placeholder {
    color: #9b948d;
}

.field input:focus,
.field select:focus {
    background: #ffffff;
    border-color: var(--signup-orange);
    box-shadow: 0 0 0 4px rgba(231, 91, 18, 0.12);
}

.phone-input-shell {
    align-items: stretch;
    background: #ffffff;
    border: 1px solid #d7cec5;
    border-radius: 12px;
    direction: ltr;
    display: flex;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.phone-input-shell:focus-within {
    border-color: var(--signup-orange);
    box-shadow: 0 0 0 4px rgba(231, 91, 18, 0.12);
}

.country-code-pill {
    align-items: center;
    background: var(--signup-orange-soft);
    border-right: 1px solid #f4c5a4;
    color: var(--signup-orange-dark);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 800;
    gap: 6px;
    padding: 0 14px;
    white-space: nowrap;
}

.country-code-pill span {
    color: var(--signup-orange);
    font-size: 11px;
    letter-spacing: 0;
}

.field .phone-input-shell input {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    direction: ltr;
    min-width: 0;
    padding-left: 14px;
}

.field .phone-input-shell input:focus {
    border-color: transparent;
    box-shadow: none;
}

.help-text {
    color: var(--signup-muted);
    font-size: 12px;
    line-height: 1.7;
    margin-top: 6px;
}

.error-text {
    color: var(--signup-danger);
    font-size: 13px;
    line-height: 1.7;
    margin-top: 6px;
}

.alert {
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 16px;
    padding: 12px 14px;
}

.alert-error {
    background: #fff4f2;
    border: 1px solid #f4c7c2;
    color: #912018;
}

.alert-info {
    background: var(--signup-orange-soft);
    border: 1px solid #f4c5a4;
    color: #934011;
}

.submit-btn {
    align-items: center;
    background: var(--signup-orange);
    border: 0;
    border-radius: 12px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    font-size: 16px;
    font-weight: 800;
    gap: 8px;
    justify-content: center;
    min-height: 54px;
    padding: 15px 18px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    width: 100%;
}

.submit-btn:hover {
    background: var(--signup-orange-dark);
    box-shadow: 0 10px 22px rgba(187, 63, 10, 0.22);
    transform: translateY(-1px);
}

.submit-btn:focus-visible,
.footer-link a:focus-visible,
.signup-visual-brand:focus-visible {
    outline: 3px solid rgba(231, 91, 18, 0.38);
    outline-offset: 4px;
}

.submit-btn:disabled,
.submit-btn.is-submitting {
    background: var(--signup-orange-dark);
    cursor: not-allowed;
    opacity: 0.78;
    pointer-events: none;
}

.submit-spinner {
    animation: signup-spin 0.9s linear infinite;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    border-top-color: #ffffff;
    display: inline-block;
    flex: 0 0 auto;
    height: 18px;
    width: 18px;
}

.submit-spinner[hidden] {
    display: none;
}

@keyframes signup-spin {
    to {
        transform: rotate(360deg);
    }
}

.footer-link {
    margin-top: 22px;
    text-align: center;
}

html[dir="rtl"] .signup-page {
    grid-template-columns: minmax(420px, 56fr) minmax(300px, 44fr);
}

html[dir="rtl"] .signup-visual {
    grid-column: 2;
}

html[dir="rtl"] .signup-content {
    direction: rtl;
    grid-column: 1;
}

html[dir="rtl"] .signup-visual-inner,
html[dir="rtl"] .signup-visual-copy {
    direction: rtl;
}

html[dir="rtl"] .signup-topbar {
    justify-content: flex-start;
}

@media (max-width: 900px) {
    .signup-page {
        display: block;
        padding: 0;
    }

    .signup-visual {
        border-radius: 0 0 24px 24px;
        height: 240px;
        position: relative;
        top: auto;
    }

    .signup-visual-inner {
        min-height: 0;
        padding: 22px 24px;
    }

    .signup-visual-brand img {
        max-width: 108px;
        width: 108px;
    }

    .signup-visual-copy {
        margin-top: 12px;
        max-width: 100%;
    }

    .signup-visual-kicker,
    .signup-visual-description {
        display: none;
    }

    .signup-visual-title {
        font-size: clamp(20px, 4vw, 26px);
        margin-top: 0;
    }

    .signup-retail-grid {
        gap: 8px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: minmax(0, 1fr);
        margin-top: 14px;
    }

    .signup-retail-grid img { border-radius: 10px; }
    .signup-retail-primary {
        grid-row: auto;
        object-position: center 20%;
    }

    .signup-content {
        direction: ltr;
        grid-column: auto;
    }

    html[dir="rtl"] .signup-content {
        direction: rtl;
    }

    .signup-content-inner {
        max-width: 600px;
        padding: 20px 16px 32px;
    }

    .auth-panel {
        margin-top: 18px;
    }
}

@media (max-width: 480px) {
    .signup-visual {
        height: 240px;
    }

    .signup-visual-inner {
        padding: 18px 20px;
    }

    .signup-visual-copy {
        margin-top: 12px;
        max-width: 100%;
    }

    .signup-visual-title {
        font-size: 20px;
        margin-top: 0;
    }

    .signup-topbar {
        min-height: 28px;
    }

    .signup-topbar-prompt,
    .footer-link {
        font-size: 12px;
    }

    .auth-panel {
        margin-top: 16px;
    }

    .step-list {
        margin-bottom: 24px;
    }

    .step-item {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Login shares the signup shell and retail artwork. */
.signup-page[data-step="login"] .login-password-label {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: space-between;
    margin-bottom: 8px;
}
.signup-page[data-step="login"] .login-password-label label { margin: 0; }
.signup-page[data-step="login"] .login-password-label a {
    color: var(--signup-orange-dark);
    font-size: 13px;
    text-decoration: none;
}
.signup-page[data-step="login"] .login-password-label a:hover { text-decoration: underline; }
.signup-page[data-step="login"] .login-password-shell { position: relative; }
.signup-page[data-step="login"] .login-password-shell input { padding-inline-end: 82px; }
.signup-page[data-step="login"] .login-password-toggle {
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--signup-orange-dark);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    inset-inline-end: 5px;
    min-height: 44px;
    min-width: 68px;
    padding: 8px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}
.signup-page[data-step="login"] .login-password-toggle:hover { background: var(--signup-orange-soft); }
.signup-page[data-step="login"] .login-password-toggle:focus-visible,
.signup-page[data-step="login"] .login-password-label a:focus-visible {
    outline: 2px solid var(--signup-orange);
    outline-offset: 2px;
}
.signup-page[data-step="login"] [hidden] { display: none !important; }
@media (min-width: 901px) {
    .signup-page[data-step="login"] .signup-content-inner {
        display: flex;
        flex-direction: column;
        min-height: calc(100dvh - 32px);
    }
    .signup-page[data-step="login"] .auth-panel {
        margin-block: auto;
        padding-block: 40px;
        width: 100%;
    }
}
