/* A shop's own log-in and password pages (auth/*, P21), in the Linki look of
   the sign-up (assets_super/css/register.css): sand page, white card, ink
   text, indigo for the platform, the orange button with ink text. Strictly
   flat: no gradients, no glows, no coloured shadows. Phone first: 16px text
   in fields (no zoom on focus), tap targets of 44px and more. */

:root {
    color-scheme: light;
    --al-indigo: #3b2fbf;
    --al-orange: #ff7a29;
    --al-orange-dark: #e56516;
    --al-sand: #f6f1e9;
    --al-ink: #1a1830;
    --al-muted: #5d5a70;
    --al-hair: rgba(26, 24, 48, 0.09);
    --al-hair-strong: rgba(26, 24, 48, 0.18);
    --al-danger: #c03530;
    --al-danger-tint: #fbe9e7;
    --al-ok-tint: #eeeefc;
    --al-r: 12px;
    --al-r-lg: 20px;
    --al-display: 'Manrope', 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --al-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

[hidden] {
    display: none !important;
}

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

body.al {
    margin: 0;
    min-height: 100vh;
    background: var(--al-sand);
    color: var(--al-ink);
    font-family: var(--al-body);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

.al :focus-visible {
    outline: 3px solid rgba(59, 47, 191, 0.4);
    outline-offset: 2px;
}

.al-shell {
    max-width: 28rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.al-header {
    background: #fff;
    border-bottom: 1px solid var(--al-hair);
}

.al-header .al-shell {
    display: flex;
    align-items: center;
    min-height: 60px;
}

.al-logo img {
    display: block;
    width: 88px;
    height: 45px;
}

.al-main {
    padding-top: 1.75rem;
    padding-bottom: 1.5rem;
}

@media (min-width: 700px) {
    .al-main {
        padding-top: 4rem;
    }
}

.al-card {
    padding: 1.5rem 1.15rem 1.25rem;
    background: #fff;
    border: 1px solid var(--al-hair);
    border-radius: var(--al-r-lg);
}

@media (min-width: 480px) {
    .al-card {
        padding: 2rem 2rem 1.5rem;
    }
}

.al-shop-logo {
    display: block;
    max-width: 160px;
    height: 48px;
    margin-bottom: 1rem;
    object-fit: contain;
    object-position: left center;
}

.al-card h1 {
    margin: 0 0 0.35rem;
    font-family: var(--al-display);
    font-size: clamp(1.6rem, 6vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.al-sub {
    margin: 0 0 1.35rem;
    color: var(--al-muted);
    line-height: 1.55;
}

.al-welcome {
    margin: -0.5rem 0 1.25rem;
    padding: 0.75rem 0.9rem;
    background: var(--al-sand);
    border-radius: var(--al-r);
    font-size: 0.95rem;
}

/* ── Messages ───────────────────────────────────────────────────────────── */

.auth-alert {
    margin-bottom: 1.1rem;
    padding: 0.8rem 1rem;
    border-radius: var(--al-r);
    font-size: 0.93rem;
    font-weight: 700;
}

.auth-alert ul {
    margin: 0;
    padding-left: 1.1rem;
}

.auth-alert.error {
    background: var(--al-danger-tint);
    color: var(--al-danger);
}

.auth-alert.success {
    background: var(--al-ok-tint);
    color: var(--al-indigo);
}

/* ── Fields ─────────────────────────────────────────────────────────────── */

.field {
    margin-bottom: 1.05rem;
}

.field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
    font-weight: 800;
}

.al .al-input {
    display: block;
    width: 100%;
    min-height: 52px;
    padding: 0.7rem 0.95rem;
    background: #fff;
    border: 1px solid var(--al-hair-strong);
    border-radius: var(--al-r);
    color: var(--al-ink);
    font: inherit;
    font-size: 1rem;
    transition: border-color 140ms ease;
}

.al .al-input::placeholder {
    color: #8a8799;
}

.al .al-input:focus {
    outline: 3px solid rgba(59, 47, 191, 0.25);
    outline-offset: 0;
    border-color: var(--al-indigo);
}

.al-password {
    position: relative;
}

.al-password .al-input {
    padding-right: 4.5rem;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 0.3rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0 0.75rem;
    transform: translateY(-50%);
    background: none;
    border: 0;
    border-radius: 10px;
    color: var(--al-indigo);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
}

/* "+250" before the phone number. */
.al-addon {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--al-hair-strong);
    border-radius: var(--al-r);
    overflow: hidden;
}

.al-addon:focus-within {
    outline: 3px solid rgba(59, 47, 191, 0.25);
    border-color: var(--al-indigo);
}

.al-addon-text {
    display: flex;
    align-items: center;
    padding: 0 0.8rem;
    background: var(--al-sand);
    color: var(--al-muted);
    font-weight: 700;
}

.al .al-addon .al-input {
    min-width: 0;
    border: 0;
    border-radius: 0;
}

.al .al-addon .al-input:focus {
    outline: none;
}

.form-meta {
    display: flex;
    justify-content: flex-end;
    margin: -0.35rem 0 0.9rem;
}

.al .auth-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--al-indigo);
    font-size: 0.95rem;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

/* The one button: ink on orange (white on this orange fails contrast). */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 54px;
    padding: 0.8rem 1.2rem;
    background: var(--al-orange);
    border: 0;
    border-radius: var(--al-r);
    color: var(--al-ink);
    font: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 140ms ease;
}

.auth-btn:hover {
    background: var(--al-orange-dark);
}

.auth-btn:disabled {
    cursor: wait;
}

.auth-btn .btn-loading {
    display: none;
    align-items: center;
    gap: 0.55rem;
}

.auth-btn.auth-is-loading .btn-text {
    display: none;
}

.auth-btn.auth-is-loading .btn-loading {
    display: inline-flex;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(26, 24, 48, 0.25);
    border-top-color: var(--al-ink);
    border-radius: 50%;
    animation: al-spin 0.7s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation-duration: 2s;
    }
}

/* Log in with a phone code. */
.pl-or {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 0.9rem;
    color: var(--al-muted);
    font-size: 0.88rem;
}

.pl-or::before,
.pl-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--al-hair);
}

.pl-ghost {
    width: 100%;
    min-height: 52px;
    background: #fff;
    border: 1px solid var(--al-hair-strong);
    border-radius: var(--al-r);
    color: var(--al-ink);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.pl-ghost:hover {
    border-color: var(--al-ink);
}

.pl-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 1rem;
    margin-top: 0.6rem;
}

.pl-link {
    min-height: 44px;
    padding: 0;
    background: none;
    border: 0;
    color: var(--al-indigo);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.al-back {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 0.6rem;
    color: var(--al-muted);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
}

.al-back:hover {
    color: var(--al-ink);
    text-decoration: underline;
}

.al-footer {
    padding-bottom: 1.75rem;
    color: var(--al-muted);
    font-size: 0.86rem;
    text-align: center;
}

/* The super admin forms: "Keep me logged in", and a spinner that shows only
   while the form is sent (login.js / forgot-password.js add .is-loading). */
.form-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0 1rem;
    margin: -0.35rem 0 0.9rem;
}

.al-check {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    font-size: 0.95rem;
    cursor: pointer;
}

.al-check input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--al-indigo);
}

.auth-btn > .spinner {
    display: none;
}

.auth-btn.is-loading > .spinner {
    display: inline-block;
}

.toggle-password svg {
    display: block;
}

/* "Continue with Google" (P26): Google's white button with its "G". */
.al .al-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    color: var(--al-ink);
    text-decoration: none;
}

.al .al-google .google-g,
.al-shop .google-g {
    flex: none;
}

.al-google + .pl-ghost,
.auth-btn + .pl-ghost {
    margin-top: 0.6rem;
}

/* Choose a shop: one Google account that owns several (P26). */
.al-shops {
    display: grid;
    gap: 0.6rem;
    margin: 0 0 0.5rem;
    padding: 0;
    list-style: none;
}

.al-shops form {
    margin: 0;
}

.al-shop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    min-height: 64px;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--al-hair-strong);
    border-radius: var(--al-r);
    color: var(--al-ink);
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.al-shop:hover {
    border-color: var(--al-ink);
}

.al-shop-text {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.al-shop-text strong {
    font-weight: 800;
    overflow-wrap: anywhere;
}

.al-shop-text span {
    color: var(--al-muted);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.al-shop-open {
    flex: none;
    color: var(--al-indigo);
    font-weight: 800;
}

/* Shop plans (P28): "Continue with Google" is the only way in. Google's own
   white button (its brand rules allow white, dark or neutral), made the main action. */
.al .al-google-only {
    min-height: 56px;
    font-size: 1.05rem;
}

.al-google-note {
    margin: 0.75rem 0 0;
    color: var(--al-muted);
    font-size: 0.9rem;
    text-align: center;
}
