/* ==========================================================================
   Auth pages (login) — built on tokens.css
   ========================================================================== */

.ds-auth {
    background: #fbf7f6;
    padding: 48px 16px 64px;
    flex: 1 0 auto;
}
.ds-auth__card {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    background: var(--ds-surface);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-xl);
    overflow: hidden;
    box-shadow: var(--ds-shadow);
}

/* Brand panel */
.ds-auth__aside {
    flex: 1 1 380px;
    background: var(--ds-ink);
    color: #fff;
    padding: 48px 40px;
    display: flex;
    align-items: center;
}
.ds-auth__badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    padding: 6px 14px; border-radius: 999px;
    font-size: 14px; font-weight: 700;
}
.ds-auth__dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.ds-auth__aside-title {
    margin: 20px 0 0;
    font-size: 30px;
    line-height: 1.4;
    font-weight: 800;
}
.ds-auth__list {
    list-style: none; padding: 0; margin: 24px 0 0;
    display: flex; flex-direction: column; gap: 12px;
    font-size: 16px; color: #e7e5e4; font-weight: 600;
}
.ds-auth__list li { display: flex; align-items: center; gap: 10px; }
.ds-auth__list i {
    flex: 0 0 26px; height: 26px; border-radius: 50%;
    background: var(--ds-primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px;
}

/* Form panel */
.ds-auth__form {
    flex: 1 1 420px;
    min-width: 0;
    padding: 48px 40px;
}
.ds-auth__title { margin: 0; font-size: 30px; font-weight: 800; }
.ds-auth__subtitle { margin: 6px 0 24px; color: var(--ds-text-2); font-size: 16px; line-height: 1.7; }
.ds-auth__link { color: var(--ds-primary-text); font-weight: 700; }
.ds-auth__link:hover { color: #8a0c26; text-decoration: underline; }
.ds-auth__footer {
    margin: 24px 0 0; padding-top: 20px;
    border-top: 1px solid var(--ds-line);
    text-align: center; color: var(--ds-text-2); font-size: 15px;
}
/* Hidden identifier field: only its error line is visible */
.ds-auth__identifier-error { margin-top: -.75rem; margin-bottom: 1rem; }
.ds-auth__identifier-error .invalid-feedback:empty { display: none; }

/* Segmented control (email / phone) */
.ds-segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    margin-bottom: 20px;
    background: var(--ds-neutral-bg);
    border-radius: var(--ds-radius-md);
}
.ds-segmented button {
    min-height: 44px;
    border: 0;
    border-radius: var(--ds-radius);
    background: transparent;
    color: var(--ds-text-2);
    font: inherit;
    font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.ds-segmented button[aria-selected="true"] {
    background: #fff;
    color: var(--ds-ink);
    box-shadow: 0 1px 3px rgba(20, 20, 20, .12);
}

/* Password with show/hide */
.ds-password { position: relative; }
.ds-password .form-control { padding-inline-end: 52px; }
[dir="rtl"] .ds-password .form-control { text-align: right; }
.ds-password__toggle {
    position: absolute;
    top: 2px;
    inset-inline-end: 2px;
    width: 44px; height: 44px;
    border: 0; background: transparent;
    color: var(--ds-muted);
    border-radius: var(--ds-radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; cursor: pointer;
}
.ds-password__toggle:hover { color: var(--ds-ink); }
.ds-password .form-control.is-invalid { background-image: none; }

/* intl-tel-input */
.ds-auth .iti { width: 100%; }
.ds-auth .iti__tel-input { width: 100%; min-height: var(--ds-control-h); }

#login-submit[aria-busy="true"] { pointer-events: none; opacity: .85; }

/* Mobile: hide the brand panel, keep the form first */
@media (max-width: 767.98px) {
    .ds-auth { padding: 20px 12px 40px; background: var(--ds-surface); }
    .ds-auth__card { border: 0; box-shadow: none; border-radius: 0; }
    .ds-auth__aside { display: none; }
    .ds-auth__form { padding: 8px 4px; }
    .ds-auth__title { font-size: 26px; }
}

/* ---------- Sign-up additions */
.ds-auth__steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.ds-auth__steps li { display: flex; align-items: center; gap: 12px; font-weight: 700; color: #fff; }
.ds-auth__steps span {
    flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid rgba(255, 255, 255, .35); font-size: 14px;
}
.ds-auth__steps + .ds-auth__list { margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .14); }
.ds-auth__legal { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--ds-muted); line-height: 1.7; }

.ds-strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.ds-strength span { height: 4px; border-radius: 999px; background: var(--ds-line); transition: background .2s; }
.ds-strength[data-score="1"] span:nth-child(-n+1) { background: var(--ds-primary); }
.ds-strength[data-score="2"] span:nth-child(-n+2) { background: #d97706; }
.ds-strength[data-score="3"] span:nth-child(-n+3) { background: #65a30d; }
.ds-strength[data-score="4"] span { background: var(--ds-success); }
.ds-auth .field-signupform-phone .iti { width: 100%; }

/* ---------- Single-column variant (change password) */
.ds-auth__card--single { max-width: 520px; }
.ds-auth__card--single .ds-auth__form { flex-basis: 100%; }
.ds-auth__back { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin-bottom: 8px; color: var(--ds-muted); font-weight: 700; font-size: 14px; }
.ds-auth__back:hover { color: var(--ds-ink); }
[dir="rtl"] .ds-auth__back span { display: inline-block; transform: scaleX(-1); }
.ds-auth__icon {
    width: 52px; height: 52px; border-radius: 14px; margin-bottom: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--ds-primary-soft); color: var(--ds-primary-text); font-size: 24px;
}
.ds-auth__forgot { margin-top: -6px; margin-bottom: 4px; text-align: end; }
.ds-auth__sep { margin: 16px 0 18px; border-color: var(--ds-line); opacity: 1; }
.ds-auth__buttons { display: grid; gap: 8px; margin-top: 18px; }

.ds-rules { list-style: none; padding: 0; margin: -6px 0 16px; display: grid; gap: 4px; font-size: 13px; color: var(--ds-muted); }
.ds-rules li { display: flex; align-items: center; gap: 8px; }
.ds-rules li.is-ok { color: var(--ds-success); font-weight: 700; }
.ds-match { min-height: 20px; margin-top: 6px; font-size: 13px; font-weight: 700; }
.ds-match.is-ok { color: var(--ds-success); }
.ds-match.is-bad { color: var(--ds-danger); }

/* Signup: where do you sell (page / website) */
.ds-channel { border: 0; padding: 0; margin: 0; }
.ds-channel legend { float: none; width: auto; font-size: inherit; }
.ds-channel__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ds-channel__opt { position: relative; margin: 0; cursor: pointer; }
.ds-channel__opt input { position: absolute; opacity: 0; inset: 0; }
.ds-channel__card { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 12px;
                    border: 1.5px solid var(--ds-line, #e7e5e4); border-radius: 12px; background: #fff; font-weight: 700; text-align: center; }
.ds-channel__card i { font-size: 1.2rem; }
.ds-channel__opt input:checked + .ds-channel__card { border-color: var(--ds-primary, #dc143c); background: color-mix(in srgb, var(--ds-primary, #dc143c) 8%, #fff); color: var(--ds-primary-text, #b01030); }
.ds-channel__opt input:focus-visible + .ds-channel__card { outline: 2px solid var(--ds-primary, #dc143c); outline-offset: 2px; }
.ds-channel.has-error .ds-channel__card { border-color: #dc3545; }
