/* ==========================================================================
   BASMATI — authentication & onboarding
   Layered on top of basmati-ui.css; reuses its tokens, buttons and fields.
   ========================================================================== */

.bs-auth-body {
    min-height: 100dvh;
    background-color: var(--bs-bg);
}

.bs-auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 100dvh;
}

/* --------------------------------------------------------------------------
   Brand panel
   -------------------------------------------------------------------------- */
.bs-auth-aside { display: none; }

/*
 * The brand panel is capped, not proportional.
 *
 * It used to take 5fr against the form's 6fr — roughly 45% of the window at
 * every size. On a 1280px screen that left the onboarding wizard about 620px to
 * lay out two columns of fields plus the opening-hours editor, and on anything
 * smaller it was worse. The panel is decoration; the form is the work. It now
 * gets a fixed slice and the form takes everything else, and it does not appear
 * at all until the window is wide enough to afford it.
 */
@media (min-width: 1080px) {
    .bs-auth { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); }
    .bs-auth-aside { display: block; padding: 44px 40px; }
}

@media (min-width: 1500px) {
    .bs-auth { grid-template-columns: minmax(0, 480px) minmax(0, 1fr); }
    .bs-auth-aside { padding: 56px 52px; }
}

.bs-auth-aside {
    position: relative;
    overflow: hidden;
    padding: 48px;
    color: #fff;
    background-color: #0b1220;
    background-image:
        radial-gradient(120% 130% at 0% 0%, #1e3a8a 0%, rgba(30, 58, 138, 0) 58%),
        radial-gradient(100% 120% at 100% 100%, #1d4ed8 0%, rgba(29, 78, 216, 0) 55%),
        linear-gradient(160deg, #0b1220 0%, #111c34 100%);
}

.bs-auth-aside::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(55% 80% at 80% 15%, rgba(59, 130, 246, 0.28) 0%, rgba(59, 130, 246, 0) 70%);
    pointer-events: none;
}

.bs-auth-aside-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
    height: 100%;
    max-width: 460px;
}

.bs-auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    text-decoration: none;
}

.bs-auth-logo {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    object-fit: contain;
    background-color: rgba(255, 255, 255, 0.1);
}

.bs-auth-pitch {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.18;
}

.bs-auth-pitch-sub {
    margin-top: 12px;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.66);
    max-width: 42ch;
}

.bs-auth-points {
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bs-auth-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.86);
}

.bs-auth-point-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    color: #93c5fd;
    background-color: rgba(255, 255, 255, 0.09);
}

.bs-auth-foot {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.42);
}

/* --------------------------------------------------------------------------
   Form panel
   -------------------------------------------------------------------------- */
.bs-auth-main {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Space at the foot no longer has to be reserved for an absolutely
       positioned language switcher — it sits in the flow now. */
    padding: 40px 20px;
}

@media (min-width: 1080px) {
    .bs-auth-main { padding: 48px 40px; }
}

.bs-auth-card {
    width: 100%;
    max-width: 420px;
}

/* Wider shell for the onboarding wizard — it carries two columns of fields and
   a seven-row opening-hours editor, which 720px could not hold comfortably. */
.bs-auth-card-wide { max-width: 940px; }

.bs-auth-brand-sm {
    color: var(--bs-text);
    margin-bottom: 28px;
}

.bs-auth-brand-sm .bs-auth-logo { background-color: var(--bs-surface-2); }

@media (min-width: 960px) {
    .bs-auth-brand-sm { display: none; }
}

.bs-auth-head { margin-bottom: 26px; }

.bs-auth-title {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: var(--bs-text);
    line-height: 1.2;
}

.bs-auth-sub {
    margin-top: 7px;
    font-size: 0.9375rem;
    color: var(--bs-text-muted);
}

.bs-auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: var(--bs-r-md);
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--bs-tone);
    background-color: var(--bs-tone-soft);
}

.bs-auth-alert svg { flex-shrink: 0; margin-top: 1px; }
.bs-auth-alert ul { margin: 0; padding-inline-start: 16px; }

/*
 * Form rhythm.
 *
 * `.bs-field` only carries an internal gap between its label and its control —
 * on the in-app screens the surrounding .bs-form-grid supplies the spacing
 * between fields. The auth forms stack fields straight into <form>, where there
 * was no grid and therefore no spacing at all, so each label sat flush against
 * the input above it and the fields read as overlapping. This is that spacing.
 */
.bs-auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* The submit button gets a little more air than the gaps between fields. */
.bs-auth-form > .bs-btn { margin-top: 2px; }

/* Password field with a reveal toggle */
.bs-auth-pass { position: relative; }

.bs-auth-pass .bs-input { padding-inline-end: 44px; }

.bs-auth-eye {
    position: absolute;
    inset-inline-end: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--bs-r-sm);
    background: none;
    color: var(--bs-text-muted);
    cursor: pointer;
}

.bs-auth-eye:hover { background-color: var(--bs-surface-2); color: var(--bs-text); }

/* No vertical margin: .bs-auth-form's gap already spaces this row from the
   field above and the button below. Keeping both double-spaced it. */
.bs-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.bs-auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--bs-text-secondary);
    cursor: pointer;
}

.bs-auth-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bs-primary);
    text-decoration: none;
}

.bs-auth-link:hover { color: var(--bs-primary-700); }

/* A link that is really a submit button (log out, toggle recovery code). */
.bs-auth-linkbtn {
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

.bs-auth-row-center { justify-content: center; margin-top: 18px; }

.bs-auth-alt {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--bs-border);
    text-align: center;
    font-size: 0.875rem;
    color: var(--bs-text-muted);
}

/*
 * In the flow, not pinned.
 *
 * This was position:absolute at the bottom of the panel. A tall form — register,
 * or login with several validation errors — grew past the centred layout and
 * ran straight underneath it, so the switcher sat on top of the submit button.
 */
.bs-auth-lang {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.bs-auth-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-r-full);
    background-color: var(--bs-surface);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bs-text-secondary);
    cursor: pointer;
    transition: background-color var(--bs-fast) var(--bs-ease);
}

.bs-auth-lang-btn:hover { background-color: var(--bs-surface-2); }

/* --------------------------------------------------------------------------
   Onboarding wizard
   -------------------------------------------------------------------------- */
.bs-steps {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
}

.bs-step {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    text-align: center;
}

/* Connector line between markers */
.bs-step::before {
    content: '';
    position: absolute;
    top: 15px;
    inset-inline-start: -50%;
    width: 100%;
    height: 2px;
    background-color: var(--bs-border);
}

.bs-step:first-child::before { display: none; }
.bs-step.is-done::before,
.bs-step.is-active::before { background-color: var(--bs-primary); }

.bs-step-dot {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--bs-border);
    background-color: var(--bs-surface);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--bs-text-muted);
    transition: all var(--bs-base) var(--bs-ease);
}

.bs-step.is-active .bs-step-dot {
    border-color: var(--bs-primary);
    background-color: var(--bs-primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--bs-primary-soft);
}

.bs-step.is-done .bs-step-dot {
    border-color: var(--bs-primary);
    background-color: var(--bs-primary);
    color: #fff;
}

.bs-step-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--bs-text-muted);
    line-height: 1.3;
}

.bs-step.is-active .bs-step-label { color: var(--bs-primary); }
.bs-step.is-done .bs-step-label { color: var(--bs-text-secondary); }

.bs-panel { display: none; }
.bs-panel.is-active { display: block; animation: bs-fade-up var(--bs-base) var(--bs-ease) both; }

.bs-panel-title {
    font-size: 1.0625rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--bs-text);
}

.bs-panel-sub {
    margin-top: 4px;
    margin-bottom: 22px;
    font-size: 0.8125rem;
    color: var(--bs-text-muted);
}

/* `.bs-form-grid` / `.bs-col-span-2` live in basmati-ui.css — the in-app team
   screens use them too, and only that sheet is loaded there. */

.bs-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bs-input-row .bs-input { flex: 1 1 auto; min-width: 0; }
.bs-input-row .bs-btn { flex-shrink: 0; }

/* Geolocation helper card */
.bs-locate {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-r-md);
    background-color: var(--bs-surface-2);
    flex-wrap: wrap;
}

.bs-locate-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: var(--bs-r-md);
    color: var(--bs-primary);
    background-color: var(--bs-primary-soft);
}

.bs-locate-body { flex: 1 1 200px; min-width: 0; }
.bs-locate-body strong { display: block; font-size: 0.8125rem; color: var(--bs-text); }
.bs-locate-body p { margin-top: 2px; font-size: 0.75rem; color: var(--bs-text-muted); }

.bs-locate-status { display: none; }

.bs-locate-status.is-shown {
    display: block;
    padding: 10px 14px;
    margin-bottom: 18px;
    border-radius: var(--bs-r-md);
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--bs-tone);
    background-color: var(--bs-tone-soft);
}

.bs-upload-name {
    display: block;
    margin-top: 2px;
    font-size: 0.75rem;
    color: var(--bs-text-muted);
    word-break: break-all;
}

/* Keeps the file input operable (and focusable) while the label carries the UI. */
.bs-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Opening-hours editor */
.bs-hours { display: flex; flex-direction: column; gap: 8px; }

.bs-hours-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-r-md);
    background-color: var(--bs-surface);
}

/*
 * `minmax(0, 1fr)`, not `1fr`.
 *
 * A bare `1fr` is `minmax(auto, 1fr)`, so the track refuses to shrink below the
 * content's min-content width. `<input type="time">` reports a large intrinsic
 * width, so in the wizard's narrow column these two tracks held the row wider
 * than its container and the fields ran over their neighbours. Allowing the
 * tracks to shrink to zero lets the inputs size to the space that exists.
 */
@media (min-width: 560px) {
    .bs-hours-row { grid-template-columns: 92px minmax(0, 1fr) minmax(0, 1fr) auto auto; }
}

.bs-hours-row .bs-input { min-width: 0; }

.bs-hours-day {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bs-text);
}

.bs-hours-row.is-closed .bs-input { opacity: 0.45; }

.bs-hours-closed {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.75rem;
    color: var(--bs-text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.bs-hours-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.bs-wizard-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--bs-border);
}

.bs-wizard-foot .bs-wizard-next { margin-inline-start: auto; }

/* Upload preview used for the clinic logo */
.bs-upload {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1.5px dashed var(--bs-border-strong);
    border-radius: var(--bs-r-md);
    background-color: var(--bs-surface-2);
    cursor: pointer;
    transition: border-color var(--bs-fast) var(--bs-ease);
}

.bs-upload:hover { border-color: var(--bs-primary); }

.bs-upload-preview {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: var(--bs-r-md);
    object-fit: cover;
    background-color: var(--bs-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-text-muted);
}

.dark .bs-auth-lang-btn,
.dark .bs-upload,
.dark .bs-step-dot { background-color: var(--bs-surface) !important; }
.dark .bs-upload { background-color: var(--bs-surface-2) !important; }
