/*
 * Phone login and onboarding (below 768px): the Swift app's logged-out flow, built from
 * Swift main's FigmaOnboardingViewController (splash, Choose Your Look, five slides, the
 * Log In / Sign Up landing) and FigmaLoginViewController (Kemar 2026-10-17: "update the
 * swift shell login page and add onboarding pages as well"). Artwork is the Figma exports
 * from Swift's asset catalog. Linked with media="(max-width: 767.98px)": tablet and desktop
 * keep the Laravel login untouched.
 *
 * Swift scales onboarding by the screen: DesignTokens.Scale.horizontal(v) = width / 375 * v,
 * vertical(v) = height / 812 * v, fontSize = horizontal. --sx and --sy are those factors.
 * A browser draws no status bar or home indicator inside the page, so Swift's safe-area
 * edges are the viewport's edges here.
 */
@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/cairo-latin-400-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('./fonts/cairo-latin-600-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/cairo-latin-700-normal.woff2') format('woff2');
}

html,
body.login {
    margin: 0;
    background: #ffffff;
}

/* The Laravel login markup stays in the page for tablet and desktop. */
body.login > :not(.sw-auth):not(script) {
    display: none !important;
}

.sw-auth {
    --sx: calc(min(100vw, 430px) / 375);
    --sy: calc(100svh / 812);
    --sw-title: #292929;
    --sw-description: #5c5c5c;
    --sw-orange: #f15114;
    --sw-navy: #243141;
    --sw-blue: #0a96d4;
    --sw-tagline-orange: #f45a26;
    --sw-hairline: #e5e5e5;
    --sw-panel: #ffffff;
    --sw-field: #ffffff;
    --sw-glass: rgba(255, 255, 255, 0.62);
    --sw-button-text: #ffffff;
    --sw-error: #d92a2a;
    position: relative;
    display: block !important;
    min-height: 100svh;
    background: #ffffff;
    color: var(--sw-title);
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

html.dark .sw-auth {
    --sw-title: #ffffff;
    --sw-description: #999999;
    --sw-orange: #f46427;
    --sw-hairline: #4d4d4d;
    --sw-panel: #2e2e2e;
    --sw-field: #383838;
    --sw-glass: rgba(0, 0, 0, 0.62);
    --sw-button-text: #292929;
    --sw-tagline-orange: #f88435;
    --sw-blue: #10bbe9;
    background: #383838;
}

.sw-auth *,
.sw-auth *::before,
.sw-auth *::after {
    box-sizing: border-box;
}

/* One screen at a time, each the full viewport, centred at phone width. */
.sw-screen {
    position: fixed;
    inset: 0;
    display: none;
    overflow: hidden;
}

.sw-screen.is-active {
    display: block;
}

.sw-screen__frame {
    position: relative;
    width: min(100vw, 430px);
    height: 100%;
    margin: 0 auto;
}

/* FigmaOnboardingBackgroundView: the gradient artwork, aspect-filled. */
.sw-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.sw-theme-dark-only,
html.dark .sw-theme-light-only {
    display: none !important;
}

html.dark .sw-theme-dark-only {
    display: block !important;
}

/* FigmaThemeToggleChrome (compact): the toggle artwork, 6pt above the safe area, 16pt
   from the right, 62 x 56 scaled, aspect-fit. */
.sw-theme-button {
    position: absolute;
    top: -6px;
    right: 16px;
    z-index: 3;
    display: grid;
    width: calc(62 * var(--sx));
    height: calc(56 * var(--sy));
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.sw-theme-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* FigmaOnboardingSolidButton: buttonStatic, radius 10, button() type (SemiBold 16). */
.sw-solid-button {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: var(--sw-orange);
    color: var(--sw-button-text);
    font: 600 16px/1 'Cairo', sans-serif;
    text-decoration: none;
    cursor: pointer;
}

/* Skip / Sign Up: the glass surface with an orange 1pt border, radius 10. */
.sw-glass-button {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--sw-orange);
    border-radius: 10px;
    background: var(--sw-glass);
    color: var(--sw-title);
    font: 600 16px/1 'Cairo', sans-serif;
    text-decoration: none;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    cursor: pointer;
}

/* FigmaOnboardingText.tagline: "Shop. Ship. Simplified." */
.sw-tagline {
    margin: 0;
    font-size: calc(26 * var(--sx));
    font-weight: 700;
    line-height: 1.875;
    text-align: center;
}

.sw-tagline .is-shop { color: var(--sw-tagline-orange); }
.sw-tagline .is-ship { color: var(--sw-navy); }
.sw-tagline .is-simplified { color: var(--sw-blue); }
html.dark .sw-tagline .is-ship { color: #ffffff; }

/* ---------------------------------------------------------------- Splash
   Logo 324 x 110 scaled, then the title (Bold 32 scaled) and tagline 8pt apart, 30pt below
   the logo; the group centred 22pt above the middle; a spinner 70pt above the bottom. */
.sw-splash__content {
    position: absolute;
    top: calc(50% - 22px);
    left: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    transform: translateY(-50%);
}

.sw-splash__logo {
    width: calc(324 * var(--sx));
    height: calc(110 * var(--sy));
    object-fit: contain;
}

.sw-splash__words {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.sw-splash__title,
.sw-landing__title {
    margin: 0;
    color: var(--sw-title);
    font-weight: 700;
    text-align: center;
}

.sw-splash__title {
    font-size: calc(32 * var(--sx));
    line-height: 1.875;
}

.sw-spinner {
    position: absolute;
    bottom: 70px;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    border: 2px solid rgba(241, 81, 20, 0.25);
    border-top-color: var(--sw-orange);
    border-radius: 50%;
    animation: sw-spin 0.8s linear infinite;
}

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

/* ------------------------------------------------------- Choose Your Look
   Artwork 72pt down (260 x 310 scaled); "Choose" + "Your Look" Bold 32 scaled 20pt below;
   the description (Regular 16 on a 26pt line, scaled) 10pt below, 30pt in; the Dark /
   toggle / Light row 32pt above Continue; Continue (50 tall) 16pt above the note; the
   note 22pt above the bottom. */
.sw-look__art {
    position: absolute;
    top: calc(72 * var(--sy));
    left: 50%;
    width: calc(260 * var(--sx));
    height: calc(310 * var(--sy));
    object-fit: contain;
    transform: translateX(-50%);
}

.sw-look__title {
    position: absolute;
    top: calc(72 * var(--sy) + 310 * var(--sy) + 20 * var(--sy));
    left: 24px;
    right: 24px;
    margin: 0;
    font-size: calc(32 * var(--sx));
    font-weight: 700;
    line-height: 1.875;
    text-align: center;
}

.sw-look__title .is-choose { color: var(--sw-blue); }
.sw-look__title .is-look { color: var(--sw-navy); }
html.dark .sw-look__title span { color: #ffffff; }

.sw-copy {
    margin: 0;
    color: var(--sw-description);
    font-size: calc(16 * var(--sx));
    font-weight: 400;
    line-height: calc(26 * var(--sx));
    text-align: center;
}

/* Measured against the simulator: on Choose Your Look, Swift's copy sits 1.3-2.2pt
   higher than CSS centres it on the same line. */
.sw-look__description,
.sw-look__bottom .sw-copy {
    transform: translateY(-1.5px);
}

.sw-look__description {
    position: absolute;
    top: calc(72 * var(--sy) + 310 * var(--sy) + 20 * var(--sy) + 32 * var(--sx) * 1.875 + 10 * var(--sy));
    left: calc(30 * var(--sx));
    right: calc(30 * var(--sx));
}

.sw-look__bottom {
    position: absolute;
    right: calc(30 * var(--sx));
    bottom: max(22px, calc(22 * var(--sy)));
    left: calc(30 * var(--sx));
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.sw-look__row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: calc(32 * var(--sy));
}

.sw-look__row span {
    color: var(--sw-title);
    font-size: calc(24 * var(--sx));
    font-weight: 600;
    line-height: 1.875;
}

.sw-look__toggle {
    width: calc(78 * var(--sx));
    height: calc(45 * var(--sy));
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.sw-look__toggle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sw-look__continue {
    height: 50px;
    margin-bottom: calc(16 * var(--sy));
}

/* ---------------------------------------------------------------- Slides
   A paging scroller over the top of the screen; each slide's artwork 76pt down (313 wide at
   most, 277 tall, scaled), the two-tone title (Bold 32 on a 42pt line, scaled) 22pt below,
   the description 10pt below that. Dots 63pt above Skip, Skip / Next 22pt above the
   bottom, the scroller ending 63pt above the dots. */
.sw-slides__scroller {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: calc(max(22px, calc(22 * var(--sy))) + 46px + 63 * var(--sy) + 4px + 63 * var(--sy));
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}

.sw-slides__scroller::-webkit-scrollbar {
    display: none;
}

.sw-slide {
    position: relative;
    flex: 0 0 100%;
    scroll-snap-align: start;
}

.sw-slide__art {
    position: absolute;
    top: calc(76 * var(--sy));
    left: 50%;
    max-width: calc(313 * var(--sx));
    height: calc(277 * var(--sy));
    object-fit: contain;
    transform: translateX(-50%);
}

.sw-slide__title {
    position: absolute;
    top: calc(76 * var(--sy) + 277 * var(--sy) + 22 * var(--sy));
    left: calc(24 * var(--sx));
    right: calc(24 * var(--sx));
    margin: 0;
    color: var(--sw-navy);
    font-size: calc(32 * var(--sx));
    font-weight: 700;
    line-height: calc(42 * var(--sx));
    text-align: center;
    white-space: pre-line;
}

.sw-slide__title .is-blue { color: var(--sw-blue); }
html.dark .sw-slide__title,
html.dark .sw-slide__title .is-blue { color: #ffffff; }

.sw-slide__description {
    position: absolute;
    top: calc(76 * var(--sy) + 277 * var(--sy) + 22 * var(--sy) + 84 * var(--sx) + 10 * var(--sy));
    left: calc(30 * var(--sx));
    right: calc(30 * var(--sx));
}

/* Five 3.2pt bars, 8pt apart, 44pt in from each side; the current one orange. */
.sw-dots {
    position: absolute;
    right: calc(44 * var(--sx));
    bottom: calc(max(22px, calc(22 * var(--sy))) + 46px + 63 * var(--sy));
    left: calc(44 * var(--sx));
    display: grid;
    height: 4px;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    gap: 8px;
}

.sw-dots span {
    height: 3.2px;
    border-radius: 1.6px;
    background: var(--sw-hairline);
}

.sw-dots span.is-active {
    background: var(--sw-orange);
}

.sw-slides__skip {
    position: absolute;
    bottom: max(22px, calc(22 * var(--sy)));
    left: calc(30 * var(--sx));
    width: 69px;
    height: 46px;
}

/* Next: the title 8pt left of centre, a 12pt chevron 10pt after it. */
.sw-slides__next {
    position: absolute;
    right: calc(30 * var(--sx));
    bottom: max(22px, calc(22 * var(--sy)));
    width: 106px;
    height: 46px;
    gap: 10px;
    padding-left: 2px;
}

.sw-slides__next svg {
    width: 12px;
    height: 12px;
}

/* ---------------------------------------------------------------- Landing
   Logo centred 110pt above the middle (screen - 50 wide, 230 tall, scaled); the title (H4,
   Bold 32) 8pt above the tagline; the tagline 40pt above Log In; Log In 14pt above Sign
   Up; Sign Up 22pt above the bottom. Both buttons 50 tall, 30pt in. */
.sw-landing__logo {
    position: absolute;
    top: calc(50% - 110 * var(--sy) - 115 * var(--sy));
    left: calc(25 * var(--sx));
    width: calc(100% - 50 * var(--sx));
    height: calc(230 * var(--sy));
    object-fit: contain;
}

.sw-landing__bottom {
    position: absolute;
    right: calc(30 * var(--sx));
    bottom: max(22px, calc(22 * var(--sy)));
    left: calc(30 * var(--sx));
    display: flex;
    flex-direction: column;
}

.sw-landing__title {
    margin-bottom: calc(8 * var(--sy));
    font-size: 32px;
    line-height: 60px;
}

.sw-landing__bottom .sw-tagline {
    margin-bottom: calc(40 * var(--sy));
}

.sw-landing__login {
    height: 50px;
    margin-bottom: calc(14 * var(--sy));
}

.sw-landing__signup {
    height: 50px;
}

/* ------------------------------------------------------------------ Login
   The gradient behind; the logo centred 250pt above the middle (324 wide at most, 90 tall
   scaled); the panel covering the bottom 65% with 32pt top corners. Inside: 32pt top, 30pt
   sides, a 20pt stack. Title H4 (Bold 32) and body1 subtitle 5pt apart, 24pt after; each
   field a SemiBold 16 title with a red asterisk 5pt above a 50pt card (radius 10, hairline
   border); Forgot Password 10pt under the password and 20pt above Log In (52 tall, radius
   14); the Register line 12pt below. */
.sw-login__logo {
    position: absolute;
    top: calc(50% - 250px - 45 * var(--sy));
    left: 50%;
    width: min(calc(100% - 50px), calc(324 * var(--sx)));
    height: calc(90 * var(--sy));
    object-fit: contain;
    transform: translateX(-50%);
}

html.dark .sw-login__logo {
    top: calc(50% - 147 * var(--sy) - 153 * var(--sy));
    width: calc(321 * var(--sx));
    height: calc(306 * var(--sy));
}

.sw-login__panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 65%;
    overflow-y: auto;
    border-radius: 32px 32px 0 0;
    background: var(--sw-panel);
    -webkit-overflow-scrolling: touch;
}

.sw-login__form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0;
    padding: 32px 30px 32px;
}

.sw-login__titles {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 4px;
}

.sw-login__titles h1 {
    margin: 0;
    color: var(--sw-title);
    font-size: 32px;
    font-weight: 700;
    line-height: 60px;
}

.sw-login__titles p {
    margin: 0;
    color: var(--sw-title);
    font-size: 16px;
    font-weight: 400;
    line-height: 30px;
}

.sw-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sw-field label {
    color: var(--sw-title);
    font-size: 16px;
    font-weight: 600;
    line-height: 30px;
}

.sw-field label span {
    color: #d92a2a;
}

/* The card: 50 tall; the text 20pt in and 16pt short of the edge (46pt with the eye). */
.sw-field__card {
    position: relative;
    height: 50px;
    border: 1px solid var(--sw-hairline);
    border-radius: 10px;
    background: var(--sw-field);
}

.sw-field__card input {
    width: 100%;
    height: 100%;
    padding: 0 15px 0 19px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--sw-title);
    font: 600 14px/1 'Cairo', sans-serif;
    caret-color: #f15114;
    outline: none;
}

.sw-field__card input::placeholder {
    color: var(--sw-description);
    font-weight: 400;
    opacity: 1;
}

.sw-field__card--password input {
    padding-right: 45px;
}

.sw-field__eye {
    position: absolute;
    top: 50%;
    right: 15px;
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--sw-title);
    transform: translateY(-50%);
    cursor: pointer;
}

.sw-field__eye svg {
    width: 22px;
    height: 22px;
}

.sw-login__forgot {
    align-self: flex-start;
    margin-top: -10px;
    /* A UIButton: its title sits in UIKit's 6pt top and bottom content inset (38.25pt
       tall), so Log In starts 20pt below that, measured against the simulator. */
    padding: 6px 0;
    color: var(--sw-title);
    font-size: 14px;
    font-weight: 400;
    line-height: 26.25px;
    text-decoration: underline;
}

.sw-login__error {
    margin: 0;
    color: var(--sw-error);
    font-size: 12px;
    line-height: 22.5px;
}

.sw-login__status {
    margin: 0;
    color: #39a634;
    font-size: 12px;
    line-height: 22.5px;
}

.sw-login__submit {
    height: 52px;
    border-radius: 14px;
}

.sw-login__submit[disabled] {
    opacity: 0.7;
}

.sw-login__register {
    margin: -8px 0 0;
    color: var(--sw-title);
    font-size: 14px;
    font-weight: 400;
    line-height: 26.25px;
    text-align: center;
}

.sw-login__register a {
    color: var(--sw-title);
    font-weight: 600;
    text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
    .sw-slides__scroller {
        scroll-behavior: auto;
    }

    .sw-spinner {
        animation: none;
    }
}

/* Swift shows eye-slash while the password is hidden, the eye once it is shown. */
.sw-field__eye .is-eye,
.sw-field__eye.is-revealed .is-slash {
    display: none;
}

.sw-field__eye.is-revealed .is-eye {
    display: block;
}
