/* FuelDesk sign-in page.
   Deliberately plain: a flat background, the product mark, one focused form.
   Self-contained (doesn't load the app theme). Light/dark follows the same
   data-bs-theme attribute + stored preference as the rest of the app. */

:root {
    --fd-navy: #00234d;
    --fd-navy-hover: #00326b;
    --fd-orange: #ec6608;
    --fd-bg: #f3f4f6;
    --fd-panel: #ffffff;
    --fd-ink: #111827;
    --fd-muted: #6b7280;
    --fd-line: #d1d5db;
    --fd-line-soft: #e5e7eb;
    --fd-focus: rgba(0, 35, 77, 0.18);
    --fd-danger: #b42318;
    --fd-danger-bg: #fef3f2;
    --fd-btn: var(--fd-navy);
    --fd-btn-hover: var(--fd-navy-hover);
    --fd-btn-ink: #ffffff;
}

[data-bs-theme="dark"] {
    --fd-bg: #0b1220;
    --fd-panel: #111a2c;
    --fd-ink: #e5e7eb;
    --fd-muted: #9ca3af;
    --fd-line: #2a3446;
    --fd-line-soft: #1f2838;
    --fd-focus: rgba(236, 102, 8, 0.28);
    --fd-danger: #f97066;
    --fd-danger-bg: rgba(240, 68, 56, 0.12);
    --fd-btn: #ec6608;
    --fd-btn-hover: #f27a24;
    --fd-btn-ink: #ffffff;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body.fd-auth {
    margin: 0;
    background: var(--fd-bg);
    color: var(--fd-ink);
    font-family: "Public Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    /* the one brand accent: a thin orange line along the top edge */
    border-top: 3px solid var(--fd-orange);
}

.fd-page {
    min-height: calc(100vh - 3px);
    display: flex;
    flex-direction: column;
}

/* ── Top bar ─────────────────────────────────────────────── */
.fd-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
}

.fd-logo { height: 60px; width: auto; display: block; }

[data-bs-theme="dark"] .fd-light-only,
html:not([data-bs-theme="dark"]) .fd-dark-only { display: none; }

.fd-theme-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid var(--fd-line);
    border-radius: 8px;
    background: var(--fd-panel);
    color: var(--fd-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fd-theme-toggle:hover { color: var(--fd-ink); }
.fd-theme-toggle:focus-visible { outline: 2px solid var(--fd-orange); outline-offset: 2px; }
.fd-icon-sun { display: none; }
[data-bs-theme="dark"] .fd-icon-sun { display: block; }
[data-bs-theme="dark"] .fd-icon-moon { display: none; }

/* ── Form ────────────────────────────────────────────────── */
.fd-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 16px 48px;
}

.fd-panel {
    width: 100%;
    max-width: 380px;
    background: var(--fd-panel);
    border: 1px solid var(--fd-line-soft);
    border-radius: 12px;
    padding: 32px;
}

.fd-title {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fd-ink);
}

/* Station name + address under the heading - same left edge as everything
   else in the card. */
.fd-station {
    margin: 0;
    color: var(--fd-muted);
    font-size: 0.875rem;
    line-height: 1.45;
}

.fd-station strong { display: block; color: var(--fd-ink); font-weight: 600; font-size: 0.9375rem; letter-spacing: 0.01em; }
.fd-station span { display: block; margin-top: 2px; }

/* One consistent gap between the heading block and the form, whether or
   not a station name is set up. */
.fd-panel form { margin-top: 24px; }

.fd-alert {
    margin: 20px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--fd-danger-bg);
    color: var(--fd-danger);
    font-size: 0.875rem;
    border: 1px solid color-mix(in srgb, var(--fd-danger) 30%, transparent);
}

.fd-field { margin-bottom: 16px; }

.fd-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--fd-ink);
}

.fd-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    font: inherit;
    color: var(--fd-ink);
    background: var(--fd-panel);
    border: 1px solid var(--fd-line);
    border-radius: 8px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.fd-input:focus { border-color: var(--fd-navy); box-shadow: 0 0 0 3px var(--fd-focus); }
[data-bs-theme="dark"] .fd-input:focus { border-color: var(--fd-orange); }
.fd-input.is-invalid { border-color: var(--fd-danger); }
.fd-input.is-invalid:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--fd-danger) 20%, transparent); }

.fd-pass-wrap { position: relative; }
.fd-pass-wrap .fd-input { padding-right: 44px; }

.fd-toggle-pass {
    position: absolute;
    top: 0;
    right: 0;
    width: 42px;
    height: 42px;
    border: 0;
    background: none;
    color: var(--fd-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0 8px 8px 0;
}

.fd-toggle-pass:hover { color: var(--fd-ink); }
.fd-toggle-pass:focus-visible { outline: 2px solid var(--fd-orange); outline-offset: -2px; }

.fd-error-text, .fd-caps-hint {
    display: none;
    margin-top: 6px;
    font-size: 0.8125rem;
}

.fd-error-text { color: var(--fd-danger); }
.fd-caps-hint { color: var(--fd-orange); }
.fd-error-text.show, .fd-caps-hint.show { display: block; }

.fd-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 20px;
    font-size: 0.875rem;
    color: var(--fd-muted);
    cursor: pointer;
    user-select: none;
}

.fd-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--fd-navy); }
[data-bs-theme="dark"] .fd-check input { accent-color: var(--fd-orange); }

.fd-btn {
    width: 100%;
    height: 42px;
    border: 0;
    border-radius: 8px;
    background: var(--fd-btn);
    color: var(--fd-btn-ink);
    font: inherit;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color .15s ease;
}

.fd-btn:hover { background: var(--fd-btn-hover); }
.fd-btn:focus-visible { outline: 2px solid var(--fd-orange); outline-offset: 2px; }
.fd-btn:disabled { opacity: .75; cursor: progress; }

.fd-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fd-spin .7s linear infinite;
}

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

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

.fd-help {
    margin: 16px 0 0;
    font-size: 0.8125rem;
    color: var(--fd-muted);
}

/* ── Footer ──────────────────────────────────────────────── */
.fd-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 24px;
    padding: 16px 32px 20px;
    font-size: 0.8125rem;
    color: var(--fd-muted);
    border-top: 1px solid var(--fd-line-soft);
}

.fd-foot a { color: var(--fd-ink); font-weight: 600; text-decoration: none; }
.fd-foot a:hover, .fd-foot a:focus-visible { color: var(--fd-orange); text-decoration: underline; }

@media (max-width: 575.98px) {
    .fd-top { padding: 16px; }
    .fd-logo { height: 36px; }
    .fd-panel { padding: 24px 20px; border-radius: 10px; }
    .fd-foot { padding: 14px 16px 18px; justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .fd-spinner { animation-duration: 1.6s; }
    .fd-input, .fd-btn { transition: none; }
}
