/*
 * Swiftech Store - customer authentication screens.
 *
 * Delivered as a plain stylesheet rather than through Vite: the storefront's
 * node_modules are not installed on this server, so rebuilding the asset
 * bundles just to restyle four pages would put every other page at risk.
 */

:root {
    --sw-red: var(--color-primary, #f51e46);
    --sw-red-dark: var(--color-primary-darken-10, #d81639);
    --sw-red-soft: rgba(245, 30, 70, 0.08);

    --sw-ink: #0f1419;
    --sw-ink-2: #4a5462;
    --sw-ink-3: #6b7280;
    --sw-muted: #7b8694;

    --sw-page: #f5f6f8;
    --sw-surface: #ffffff;
    --sw-border: #e3e6ea;
    --sw-border-strong: #cdd3da;
    --sw-danger: #d02440;
    --sw-success: #0f8a52;

    --sw-radius: 14px;
    --sw-radius-sm: 10px;
    --sw-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px -12px rgba(16, 24, 40, 0.14);

    --sw-font: var(--base-font-family, "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body.sw-auth-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: var(--sw-font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--sw-ink);
    background-color: var(--sw-page);
    -webkit-font-smoothing: antialiased;
}

[x-cloak] {
    display: none !important;
}

/*======= Shell =======*/

.sw-auth {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px 48px;
}

.sw-auth__top {
    width: 100%;
    max-width: 440px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.sw-auth__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--sw-ink-2);
    text-decoration: none;
    padding: 8px 10px 8px 6px;
    margin-left: -6px;
    border-radius: var(--sw-radius-sm);
    transition: color 0.15s ease, background-color 0.15s ease;
}

.sw-auth__back:hover {
    color: var(--sw-ink);
    background-color: rgba(15, 20, 25, 0.04);
}

.sw-auth__back svg {
    flex: none;
}

.sw-auth__card {
    width: 100%;
    max-width: 440px;
    background: var(--sw-surface);
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius);
    box-shadow: var(--sw-shadow);
    padding: 36px 36px 32px;
}

.sw-auth__brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin-bottom: 22px;
}

.sw-auth__brand img {
    max-height: 38px;
    max-width: 200px;
    width: auto;
    display: block;
}

.sw-auth__wordmark {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--sw-ink);
}

.sw-auth__wordmark::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sw-red);
    margin-left: 5px;
    vertical-align: 2px;
}

.sw-auth__title {
    margin: 0 0 6px;
    font-size: 25px;
    line-height: 1.25;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--sw-ink);
}

.sw-auth__subtitle {
    margin: 0 0 26px;
    font-size: 14.5px;
    color: var(--sw-ink-2);
}

/*======= Form =======*/

.sw-field {
    margin-bottom: 18px;
}

.sw-label {
    display: block;
    margin-bottom: 7px;
    font-size: 13.5px;
    font-weight: 550;
    color: var(--sw-ink);
}

.sw-label__optional {
    font-weight: 400;
    color: var(--sw-ink-3);
}

.sw-control {
    display: block;
    width: 100%;
    height: 50px;
    padding: 0 14px;
    font-family: inherit;
    font-size: 15px;
    color: var(--sw-ink);
    background: var(--sw-surface);
    border: 1px solid var(--sw-border-strong);
    border-radius: var(--sw-radius-sm);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.sw-control::placeholder {
    color: var(--sw-muted);
}

.sw-control:hover {
    border-color: #b6bec8;
}

.sw-control:focus {
    border-color: var(--sw-red);
    box-shadow: 0 0 0 3px var(--sw-red-soft);
}

.sw-control:disabled {
    background: #f4f5f7;
    color: var(--sw-ink-3);
    cursor: not-allowed;
}

/* Phone input with the fixed +960 country code */

.sw-phone {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--sw-border-strong);
    border-radius: var(--sw-radius-sm);
    background: var(--sw-surface);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sw-phone:hover {
    border-color: #b6bec8;
}

.sw-phone:focus-within {
    border-color: var(--sw-red);
    box-shadow: 0 0 0 3px var(--sw-red-soft);
}

.sw-phone__cc {
    display: flex;
    align-items: center;
    flex: none;
    padding: 0 13px;
    font-size: 15px;
    font-weight: 550;
    font-variant-numeric: tabular-nums;
    color: var(--sw-ink-2);
    background: #f4f5f7;
    border-right: 1px solid var(--sw-border);
    user-select: none;
}

.sw-phone .sw-control {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

.sw-phone .sw-control:focus {
    box-shadow: none;
}

/* Password input with the reveal toggle */

.sw-input-group {
    position: relative;
}

.sw-input-group .sw-control {
    padding-right: 50px;
}

.sw-reveal {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sw-ink-3);
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.sw-reveal:hover {
    color: var(--sw-ink-2);
    background: rgba(15, 20, 25, 0.05);
}

.sw-reveal:focus-visible {
    outline: 2px solid var(--sw-red);
    outline-offset: 1px;
}

/* Validation */

.sw-control.is-invalid,
.sw-phone.is-invalid {
    border-color: var(--sw-danger);
}

.sw-phone.is-invalid:focus-within,
.sw-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(208, 36, 64, 0.12);
}

.sw-error {
    display: block;
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--sw-danger);
}

.sw-hint {
    display: block;
    margin: 6px 0 0;
    font-size: 12.5px;
    color: var(--sw-ink-3);
}

/*======= Checkbox, links, actions =======*/

.sw-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin: 2px 0 24px;
}

.sw-check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 14px;
    color: var(--sw-ink-2);
    user-select: none;
}

.sw-check input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--sw-red);
    cursor: pointer;
}

.sw-check input:focus-visible {
    outline: 2px solid var(--sw-red);
    outline-offset: 2px;
}

.sw-link {
    font-size: 14px;
    font-weight: 550;
    color: var(--sw-red-dark);
    text-decoration: none;
    border-radius: 4px;
}

.sw-link:hover {
    text-decoration: underline;
}

.sw-link:focus-visible {
    outline: 2px solid var(--sw-red);
    outline-offset: 2px;
}

.sw-link--muted {
    color: var(--sw-ink-2);
    font-weight: 500;
}

.sw-link--muted:hover {
    color: var(--sw-ink);
}

.sw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 52px;
    padding: 0 20px;
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 600;
    color: #fff;
    background: var(--sw-red-dark);
    border: 0;
    border-radius: var(--sw-radius-sm);
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.06s ease;
}

.sw-btn:hover:not(:disabled) {
    background: var(--sw-red);
}

.sw-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.sw-btn:focus-visible {
    outline: 2px solid var(--sw-ink);
    outline-offset: 2px;
}

.sw-btn:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.sw-btn__spinner {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sw-spin 0.65s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .sw-btn,
    .sw-control,
    .sw-phone,
    .sw-auth__back,
    .sw-reveal {
        transition: none;
    }

    .sw-btn__spinner {
        animation-duration: 2s;
    }
}

/*======= Footer =======*/

.sw-auth__footer {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--sw-border);
    text-align: center;
    font-size: 14.5px;
    color: var(--sw-ink-2);
}

.sw-auth__footer .sw-link {
    margin-left: 4px;
}

.sw-social {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.sw-social__divider {
    position: relative;
    text-align: center;
    margin: 22px 0 18px;
    font-size: 13px;
    color: var(--sw-ink-3);
}

.sw-social__divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--sw-border);
}

.sw-social__divider span {
    position: relative;
    padding: 0 12px;
    background: var(--sw-surface);
}

.sw-social__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    font-size: 14.5px;
    font-weight: 550;
    color: var(--sw-ink);
    text-decoration: none;
    background: var(--sw-surface);
    border: 1px solid var(--sw-border-strong);
    border-radius: var(--sw-radius-sm);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.sw-social__btn:hover {
    background: #f7f8f9;
    border-color: #b6bec8;
}

.sw-social__btn img {
    width: 18px;
    height: 18px;
}

/*======= Alerts =======*/

.sw-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    margin-bottom: 20px;
    border-radius: var(--sw-radius-sm);
    font-size: 14px;
    border: 1px solid transparent;
}

.sw-alert svg {
    flex: none;
    margin-top: 1px;
}

.sw-alert__body {
    flex: 1 1 auto;
}

.sw-alert--error {
    color: #8c1226;
    background: #fdf2f4;
    border-color: #f6d3da;
}

.sw-alert--success {
    color: #0b5f39;
    background: #f0faf5;
    border-color: #c6ecd8;
}

.sw-alert__close {
    flex: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
}

.sw-alert__close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

.sw-notice {
    padding: 12px 14px;
    margin-bottom: 20px;
    font-size: 13.5px;
    color: var(--sw-ink-2);
    background: #f5f6f8;
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-sm);
}

.sw-auth__legal {
    margin-top: 20px;
    text-align: center;
    font-size: 12.5px;
    color: var(--sw-ink-3);
}

/*======= Language picker =======*/

.sw-auth__top .dropdown {
    position: relative;
    z-index: 20;
}

.sw-auth__top .dropdown-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--sw-ink-2);
    text-transform: uppercase;
    background: var(--sw-surface);
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-sm);
    cursor: pointer;
}

.sw-auth__top .dropdown-list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 150px;
    list-style: none;
    margin: 0;
    padding: 6px;
    background: var(--sw-surface);
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-sm);
    box-shadow: var(--sw-shadow);
}

.sw-auth__top .dropdown-list a {
    display: block;
    padding: 8px 10px;
    font-size: 14px;
    color: var(--sw-ink-2);
    text-decoration: none;
    border-radius: 7px;
}

.sw-auth__top .dropdown-list a:hover {
    color: var(--sw-ink);
    background: #f4f5f7;
}

/*======= Mobile =======*/

@media (max-width: 575px) {
    .sw-auth {
        padding: 18px 16px 36px;
    }

    .sw-auth__top {
        max-width: none;
        margin-bottom: 18px;
    }

    .sw-auth__card {
        max-width: none;
        padding: 26px 20px 24px;
        border-radius: 16px;
    }

    .sw-auth__title {
        font-size: 23px;
    }

    .sw-auth__subtitle {
        margin-bottom: 22px;
    }

    /* Comfortable touch targets and no iOS zoom-on-focus. */
    .sw-control {
        height: 52px;
        font-size: 16px;
    }

    .sw-phone__cc {
        font-size: 16px;
        padding: 0 12px;
    }

    .sw-btn {
        min-height: 54px;
    }

    .sw-reveal {
        width: 44px;
        height: 44px;
    }

    .sw-input-group .sw-control {
        padding-right: 56px;
    }

    .rtl .sw-input-group .sw-control {
        padding-right: 14px;
        padding-left: 56px;
    }

    .sw-form-row {
        margin-bottom: 22px;
    }
}

@media (max-width: 359px) {
    .sw-auth__card {
        padding: 22px 16px 20px;
    }

    .sw-phone__cc {
        padding: 0 10px;
    }
}

/*======= RTL =======*/

.rtl .sw-phone__cc {
    border-right: 0;
    border-left: 1px solid var(--sw-border);
}

.rtl .sw-input-group .sw-control {
    padding-right: 14px;
    padding-left: 50px;
}

.rtl .sw-reveal {
    right: auto;
    left: 6px;
}

.rtl .sw-auth__back {
    margin-left: 0;
    margin-right: -6px;
}

.rtl .sw-auth__back svg {
    transform: rotate(180deg);
}

.rtl .sw-auth__wordmark::after {
    margin-left: 0;
    margin-right: 5px;
}

/* Password reveal: the slash only appears while the password is visible. */
.sw-reveal .sw-eye-slash {
    display: none;
}

.sw-reveal.is-revealed {
    color: var(--sw-ink);
}

.sw-reveal.is-revealed .sw-eye-slash {
    display: inline;
}

/* A link rendered as a button so the toggle stays keyboard and screen reader friendly. */
.sw-textbtn {
    padding: 4px 2px;
    font-family: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

/*======= Password recovery: contact details, no form =======*/

.sw-contact {
    list-style: none;
    margin: 0 0 24px;
    padding: 16px 18px;
    background: #f7f8f9;
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-sm);
}

.sw-contact__item + .sw-contact__item {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--sw-border);
}

.sw-contact__label {
    display: block;
    margin-bottom: 2px;
    font-size: 12.5px;
    color: var(--sw-ink-3);
}

.sw-contact__item .sw-link {
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.sw-btn--link {
    text-decoration: none;
}

/*===================================================================
  DARK THEME — appended 2026-09-05. Single self-contained section.
  Every rule below is gated behind [data-theme="dark"], so light mode
  is untouched by construction. Element overrides repeat the exact
  selector chain of the light rule they replace, guaranteeing a
  specificity win. Shared Swiftech dark palette: page #12151b,
  surface #181c23, chip #1f242c, border #2a303a, strong #3b424e,
  ink #e8ebef. Brand reds are intentionally unchanged.
  ===================================================================*/

:root[data-theme="dark"] {
    color-scheme: dark;

    --sw-ink: #e8ebef;
    --sw-ink-2: #a6adb8;
    --sw-ink-3: #8a919c;
    --sw-muted: #98a2ae;

    --sw-page: #12151b;
    --sw-surface: #181c23;
    --sw-border: #2a303a;
    --sw-border-strong: #3b424e;
    --sw-danger: #ff6b81;
    --sw-success: #34c98a;

    --sw-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px -12px rgba(0, 0, 0, 0.5);
}

/* --- Hardcoded light residue, dark-gated --- */

[data-theme="dark"] .sw-auth__back:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .sw-control:hover {
    border-color: #4a5158;
}

[data-theme="dark"] .sw-phone:hover {
    border-color: #4a5158;
}

[data-theme="dark"] .sw-control:disabled {
    background: #1f242c;
}

[data-theme="dark"] .sw-phone__cc {
    background: #1f242c;
}

[data-theme="dark"] .sw-reveal:hover {
    background: rgba(255, 255, 255, 0.07);
}

[data-theme="dark"] .sw-social__btn:hover {
    background: #1f242c;
    border-color: #4a5158;
}

[data-theme="dark"] .sw-alert--error {
    color: #ff9daa;
    background: rgba(245, 30, 70, 0.1);
    border-color: rgba(245, 30, 70, 0.3);
}

[data-theme="dark"] .sw-alert--success {
    color: #7fe0b2;
    background: rgba(52, 201, 138, 0.1);
    border-color: rgba(52, 201, 138, 0.3);
}

[data-theme="dark"] .sw-alert__close:hover {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .sw-notice {
    background: #1f242c;
}

[data-theme="dark"] .sw-auth__top .dropdown-list a:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .sw-contact {
    background: #1f242c;
}

/* Found on scan (unlisted residue): the invalid-field focus glow was
   derived from the light danger #d02440; align with dark danger #ff6b81. */
[data-theme="dark"] .sw-phone.is-invalid:focus-within,
[data-theme="dark"] .sw-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(255, 107, 129, 0.18);
}

/* --- Browser autofill paints its own light plate; repaint it dark --- */

[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus,
[data-theme="dark"] textarea:-webkit-autofill,
[data-theme="dark"] select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #181c23 inset !important;
    -webkit-text-fill-color: #e8ebef !important;
    caret-color: #e8ebef;
}

/*======= End dark theme =======*/
