/*
 * Floosi auth pages: login, password reset and business registration. Loaded after landing.css
 * and reuses its tokens, fonts, buttons and icons. Logical properties only, so the same rules
 * serve RTL and LTR languages.
 */

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

/* ---------- Form side ---------------------------------------------------- */
.auth__side {
    position: relative; isolation: isolate;
    display: flex; flex-direction: column;
    padding: clamp(18px, 3vw, 32px) clamp(20px, 5vw, 72px);
}
/* Faint ledger rules, the same paper as the landing hero. */
.auth__side::before {
    content: ""; position: absolute; inset: 0 0 auto; height: 460px; z-index: -1;
    background-image: repeating-linear-gradient(to bottom, transparent 0 39px, rgba(0, 113, 153, .07) 39px 40px);
    -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent);
    mask-image: linear-gradient(to bottom, #000 20%, transparent);
}
.auth__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; }
.auth__brand { flex: none; }
.auth__logo { width: 148px; height: auto; }

.auth__lang {
    position: relative; display: inline-flex; align-items: center; gap: 6px;
    height: 40px; padding-inline: 12px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-btn);
    background: var(--white); color: var(--muted);
    transition: border-color .2s;
}
.auth__lang:hover, .auth__lang:focus-within { border-color: var(--teal); }
.auth__lang .i { width: 18px; height: 18px; }
.auth__lang select {
    -webkit-appearance: none; appearance: none;
    max-width: 11.5em; padding-inline-end: 20px; border: 0; outline: none; background: transparent;
    font: inherit; font-size: 14.5px; font-weight: 700; color: var(--ink); cursor: pointer;
    field-sizing: content; /* as wide as the chosen language, not the longest one, where supported */
}
.auth__lang .auth__chevron { position: absolute; inset-inline-end: 10px; width: 16px; height: 16px; pointer-events: none; }
.auth__lang-go { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 800; color: var(--teal); }

.auth__card { width: 100%; max-width: 420px; margin: auto; padding-block: clamp(36px, 7vh, 72px); }
.auth__title {
    font-size: clamp(2.1rem, 1.6rem + 1.6vw, 2.9rem);
    font-weight: 900; line-height: 1.25; letter-spacing: var(--track); color: var(--ink);
}
:root:not(:lang(ar)) .auth__title { font-weight: 800; line-height: 1.08; letter-spacing: -.035em; }
.auth__lead { margin-top: 10px; font-size: 16.5px; color: var(--muted); }

.alert {
    display: flex; align-items: flex-start; gap: 10px;
    margin-top: 24px; padding: 12px 14px; border-radius: 12px;
    font-size: 15px; font-weight: 700; line-height: 1.6;
}
.alert .i, .alert .tick { width: 19px; height: 19px; margin-top: .15em; }
.alert--error { border: 1px solid rgba(163, 63, 0, .2); background: var(--orange-50); color: var(--orange-ink); }
.alert--ok { border: 1px solid rgba(0, 113, 153, .2); background: var(--teal-50); color: var(--teal-deep); }

.auth__form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 30px; }

/* ---------- Fields --------------------------------------------------------
 * Text inputs and selects sit in .field__control and share one look; the checkbox (.check) and
 * the logo picker (.file) keep their own.
 */
.field > label:not(.check, .file), .field__label-row label, .field__label {
    display: block; margin-bottom: 8px; font-size: 14.5px; font-weight: 800; color: var(--ink);
}
.field__label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.field__label-row label { margin-bottom: 0; }
.field__optional { margin-inline-start: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field__link { font-size: 14px; font-weight: 700; color: var(--teal); }
.field__link:hover { text-decoration: underline; text-underline-offset: 3px; }

.field__control { position: relative; }
.field__control input, .field__control select {
    width: 100%; height: 54px; padding-inline: 16px;
    border: 1px solid var(--line-2); border-radius: var(--radius-btn); background: var(--white);
    font: inherit; font-size: 16px; color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.field__control input::placeholder { color: rgba(83, 109, 124, .72); opacity: 1; }
.field__control input:hover, .field__control select:hover { border-color: rgba(18, 49, 63, .32); }
.field__control input:focus, .field__control select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(0, 113, 153, .14); }
.has-error .field__control input, .has-error .field__control select { border-color: var(--orange-ink); box-shadow: 0 0 0 4px rgba(163, 63, 0, .1); }
/* Phone numbers, e-mail and the like stay left-to-right but line up with the Arabic labels. */
[dir="rtl"] .field__control input[dir="ltr"] { text-align: right; }

.field__control--toggle input { padding-inline-end: 54px; }
.field__toggle {
    position: absolute; inset-block: 5px; inset-inline-end: 5px;
    display: grid; place-items: center; width: 44px;
    border: 0; border-radius: 8px; background: none; color: var(--muted);
}
.field__toggle:hover { background: var(--surface); color: var(--ink); }

.field__control--select select {
    -webkit-appearance: none; appearance: none;
    padding-inline-end: 46px; text-overflow: ellipsis; cursor: pointer;
}
.field__chevron {
    position: absolute; inset-block: 0; inset-inline-end: 16px; margin-block: auto;
    width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}

.field__hint { margin-top: 7px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.field__error { margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--orange-ink); }

.check { display: inline-flex; align-items: center; gap: 10px; justify-self: start; font-size: 15px; font-weight: 600; cursor: pointer; }
.check input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--teal); cursor: pointer; }
/* Google's checkbox widget is 304 x 78 px; reserve its height so the form does not jump. */
.recaptcha { min-height: 78px; }
.has-error .check input { outline: 2px solid var(--orange-ink); outline-offset: 2px; }

/* Logo picker: the real input stays focusable, the label is the visible control. */
.file {
    position: relative; display: flex; align-items: center; gap: 12px;
    min-height: 54px; padding: 6px; padding-inline-end: 14px;
    border: 1px dashed rgba(18, 49, 63, .28); border-radius: var(--radius-btn); background: var(--white);
    cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.file:hover { border-color: var(--teal); }
.file:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(0, 113, 153, .14); }
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file__button {
    display: inline-flex; align-items: center; gap: 8px; flex: none;
    height: 40px; padding-inline: 14px; border-radius: 8px;
    background: var(--teal-50); color: var(--teal-deep); font-size: 14.5px; font-weight: 800;
}
.file__button .i { width: 16px; height: 16px; stroke-width: 2; }
.file__name { min-width: 0; overflow: hidden; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }

.link-button {
    padding: 0; border: 0; background: none;
    font: inherit; font-weight: 800; color: var(--teal);
    text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.link-button:hover { color: var(--teal-deep); }

.auth__submit { margin-top: 6px; }
.auth__submit.is-loading { opacity: .9; pointer-events: none; }
.auth__submit.is-loading::before {
    content: ""; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(18, 49, 63, .28); border-top-color: var(--ink);
    animation: auth-spin .7s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth__note {
    display: flex; align-items: flex-start; gap: 10px;
    margin-top: 20px; padding: 12px 14px; border-radius: 12px; background: var(--surface);
    font-size: 14.5px; line-height: 1.7; color: var(--muted);
}
.auth__note .i { width: 18px; height: 18px; margin-top: .2em; color: var(--teal); }

.auth__alt {
    margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line);
    text-align: center; font-size: 15px; color: var(--muted);
}
.auth__alt a { font-weight: 800; color: var(--teal); }
.auth__alt a:hover { text-decoration: underline; text-underline-offset: 3px; }

.auth__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; font-size: 13.5px; color: var(--muted); }
.auth__foot a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.auth__foot a:hover { color: var(--ink); }
.auth__foot .i { width: 16px; height: 16px; }
.i--back { transform: scaleX(-1); }
[dir="rtl"] .i--back { transform: none; }

/* ---------- Registration: steps ------------------------------------------
 * register.js adds .is-stepped and shows one pane at a time. Without it the form is one long
 * page: every pane shows, and only the submit button.
 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; align-items: start; }
.form-grid + .form-grid { margin-top: 18px; }
.form-grid--names { grid-template-columns: minmax(0, .8fr) minmax(0, 1.1fr) minmax(0, 1.1fr); }
.field--full { grid-column: 1 / -1; }

.steps-meter { display: none; gap: 6px; }
.is-stepped .steps-meter { display: flex; }
.steps-meter__step { flex: 1; height: 5px; border-radius: 99px; background: var(--teal-100); transition: background-color .35s var(--ease); }
.steps-meter__step.is-current, .steps-meter__step.is-done { background: var(--teal); }

.step-pane { min-width: 0; margin: 0; padding: 0; border: 0; }
.step-pane__title { margin-bottom: 18px; padding: 0; font-size: 19px; font-weight: 800; line-height: 1.4; color: var(--ink); }
.step-pane__title .num {
    display: inline-grid; place-items: center; width: 30px; height: 30px;
    margin-inline-end: 12px; vertical-align: middle; border-radius: 9px;
    background: var(--ink); color: var(--white); font-size: 15px; line-height: 1;
}
.is-stepped .step-pane:not(.is-current) { display: none; }
.register:not(.is-stepped) .step-pane + .step-pane { padding-top: 26px; border-top: 1px solid var(--line); }
.register:not(.is-stepped) [data-next] { display: none; }

/* Optional fields fold away. */
.more { margin-top: 20px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--white); }
.more > summary {
    display: flex; align-items: center; gap: 10px; min-height: 52px; padding-inline: 16px;
    border-radius: 12px; list-style: none; cursor: pointer;
    font-size: 15px; font-weight: 800; color: var(--ink);
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary:hover { color: var(--teal); }
.more > summary .i { width: 18px; height: 18px; stroke-width: 2; color: var(--teal); transition: transform .3s var(--ease); }
.more[open] > summary { border-bottom: 1px solid var(--line); border-end-start-radius: 0; border-end-end-radius: 0; }
.more[open] > summary .i { transform: rotate(45deg); }
.more > .form-grid { padding: 18px 16px; }

.form-nav { display: flex; gap: 12px; margin-top: 6px; }
.form-nav .btn { flex: none; }
.form-nav .btn--primary { flex: 1 1 auto; min-width: 0; }
.form-nav .auth__submit { margin-top: 0; }

/* Terms and conditions (HTML from the superadmin settings). */
.terms {
    width: min(640px, calc(100vw - 32px)); max-width: none; max-height: min(82vh, 760px);
    padding: 0; border: 0; border-radius: 20px;
    background: var(--white); color: var(--ink); box-shadow: var(--shadow-lg);
}
.terms[open] { display: flex; flex-direction: column; }
.terms::backdrop { background: rgba(18, 49, 63, .55); }
.terms__title { padding: 22px 24px 0; font-size: 20px; font-weight: 800; line-height: 1.4; }
.terms__body { flex: 1 1 auto; overflow: auto; margin-top: 12px; padding: 0 24px; font-size: 15.5px; color: var(--muted); }
.terms__body > * + * { margin-top: .8em; }
.terms__body ul, .terms__body ol { padding-inline-start: 1.4em; list-style: disc; }
.terms__body ol { list-style: decimal; }
.terms__body a { color: var(--teal); text-decoration: underline; }
.terms form { display: flex; justify-content: flex-end; margin-top: 16px; padding: 16px 24px 20px; border-top: 1px solid var(--line); }

/* ---------- Brand side --------------------------------------------------- */
.auth__visual {
    position: relative; isolation: isolate; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    margin: 12px; margin-inline-start: 0; padding: clamp(32px, 5vw, 72px);
    border-radius: 28px; color: var(--white);
    background: radial-gradient(110% 70% at 70% 0%, #0a82ab 0%, var(--teal) 50%, #005d84 100%);
}
.auth__visual::before {
    content: ""; position: absolute; inset: 0; z-index: -2;
    background-image: repeating-linear-gradient(to bottom, transparent 0 39px, rgba(255, 255, 255, .06) 39px 40px);
}
.auth__visual-inner { width: 100%; max-width: 460px; }
.auth__eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 800; color: rgba(255, 255, 255, .82); }
.auth__eyebrow .eyebrow__mark { width: 8px; height: 8px; border-radius: 2px; background: var(--orange); }
.auth__visual-title {
    margin-top: 14px;
    font-size: clamp(2.2rem, 1.3rem + 2.4vw, 3.5rem);
    font-weight: 900; line-height: 1.24; letter-spacing: var(--track); text-wrap: balance;
}
:root:not(:lang(ar)) .auth__visual-title { font-weight: 800; line-height: 1.06; letter-spacing: -.04em; }

.board {
    margin-top: 32px; padding: 20px 22px;
    border-radius: 18px; background: var(--white); color: var(--ink); box-shadow: var(--shadow-lg);
}
.board__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.board__delta bdi { color: var(--teal); }
.board__value { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; font-size: 36px; font-weight: 800; line-height: 1.15; white-space: nowrap; }
.board__spark { width: 100%; height: 58px; margin-top: 12px; }
.js .board .spark__line { animation: draw 1.6s var(--ease) .35s forwards; }
.board__kpis {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
    margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line);
}
.board__kpis dt { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.board__kpis dd { overflow: hidden; font-size: 16px; font-weight: 800; white-space: nowrap; text-overflow: ellipsis; }

.auth__facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 20px; font-size: 14.5px; font-weight: 700; color: rgba(255, 255, 255, .92); }
.auth__facts li { display: inline-flex; align-items: center; gap: 8px; }
.auth__facts .tick { width: 14px; height: 14px; }

/* Password pages: a sketch of the reset e-mail. */
.mail {
    margin-top: 32px; padding: 20px 22px 22px;
    border-radius: 18px; background: var(--white); color: var(--ink); box-shadow: var(--shadow-lg);
}
.js .mail { animation: auth-rise .8s var(--ease) .15s both; }
@keyframes auth-rise { from { opacity: 0; transform: translateY(14px); } }
.mail__head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.mail__logo { flex: none; width: 40px; height: 40px; }
.mail__from { display: grid; min-width: 0; line-height: 1.4; }
.mail__from b { font-size: 15px; font-weight: 800; }
.mail__from small { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.mail__icon { margin-inline-start: auto; color: var(--muted); }
.mail__subject { margin-top: 16px; font-size: 19px; font-weight: 800; line-height: 1.4; }
.mail__line { display: block; height: 8px; margin-top: 12px; border-radius: 4px; background: #e8eff3; }
.mail__line--short { width: 64%; }
.mail__button {
    display: inline-flex; align-items: center; height: 44px; margin-top: 18px; padding-inline: 18px;
    border-radius: var(--radius-btn); background: var(--orange); color: var(--ink); font-size: 15px; font-weight: 800;
}
.mail__note { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.mail__note .i { width: 16px; height: 16px; }

/* Registration: the three steps, following the form. */
.progress {
    margin-top: 30px; padding: 4px 20px;
    border-radius: 18px; background: var(--white); color: var(--ink); box-shadow: var(--shadow-lg);
}
.progress__step { display: flex; align-items: center; gap: 14px; padding-block: 14px; }
.progress__step + .progress__step { border-top: 1px solid var(--line); }
.progress__num {
    display: grid; place-items: center; flex: none; width: 38px; height: 38px;
    border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--white);
    font-size: 15px; font-weight: 800; color: var(--muted);
    transition: background-color .3s, border-color .3s, color .3s, box-shadow .3s;
}
.progress__num .tick { display: none; width: 17px; height: 17px; }
.progress__text { display: grid; min-width: 0; line-height: 1.45; }
.progress__text b { font-size: 16px; font-weight: 800; color: var(--muted); transition: color .3s; }
.progress__text small { font-size: 13px; font-weight: 600; color: var(--muted); }
.progress__step.is-current .progress__num { border-color: var(--teal); background: var(--teal); color: var(--white); box-shadow: 0 0 0 4px var(--teal-50); }
.progress__step.is-current b, .progress__step.is-done b { color: var(--ink); }
.progress__step.is-done .progress__num { border-color: transparent; background: var(--orange-50); }
.progress__step.is-done .progress__num .num { display: none; }
.progress__step.is-done .progress__num .tick { display: block; }

.plan-chip {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    margin-top: 16px; padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, .28); border-radius: 14px; background: rgba(255, 255, 255, .1);
    font-size: 14.5px;
}
.plan-chip__label { font-weight: 700; color: rgba(255, 255, 255, .8); }
.plan-chip b { font-size: 16px; font-weight: 800; }
.plan-chip .chip { margin-inline-start: auto; }

/* The brand check, large and cropped, as on the landing page's closing panel. */
.auth__mark {
    position: absolute; z-index: -1;
    width: clamp(220px, 24vw, 340px); height: auto; aspect-ratio: 117 / 118;
    inset-inline-end: -40px; bottom: -72px;
    fill: var(--orange);
}

/* ---------- Registration: wider form, brand panel kept in view ------------- */
.auth--wide { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.auth--wide .auth__card { max-width: 640px; }
.auth--wide .auth__visual {
    position: sticky; top: 12px; align-self: start;
    height: calc(100vh - 24px); height: calc(100dvh - 24px);
}
.auth--wide .auth__visual-title { font-size: clamp(2rem, 1.2rem + 2vw, 3rem); }
.auth--wide .auth__mark { width: clamp(180px, 15vw, 220px); bottom: -64px; }
@media (max-height: 760px) {
    .auth--wide .auth__visual-title { font-size: 2rem; }
    .auth--wide .progress { margin-top: 22px; }
    .auth--wide .progress__step { padding-block: 10px; }
}

/* ---------- Small screens: the form alone, brand colours stay in the logo ---- */
@media (max-width: 960px) {
    .auth, .auth--wide { grid-template-columns: minmax(0, 1fr); }
    .auth__visual { display: none; }
    .auth__card { margin-block: 0 auto; }
}
@media (max-width: 560px) {
    .form-grid, .form-grid--names { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
    .auth__logo { width: 144px; }
    .auth__lang select { max-width: 9em; }
    .form-nav .btn { padding-inline: 18px; }
}
/* 320px phones: the logo keeps its minimum width, the language picker gives way. */
@media (max-width: 360px) {
    .auth__top { gap: 10px; }
    .auth__lang { padding-inline: 10px 8px; }
    .auth__lang .i:not(.auth__chevron) { display: none; }
    .auth__lang select { max-width: 6.5em; }
    .auth__lang .auth__chevron { inset-inline-end: 8px; }
    .form-nav { flex-direction: column-reverse; }
    .form-nav .btn { width: 100%; }
}
