:root {
    --bg: #f3f6f6;
    --bg-accent: #e6eded;
    --panel: rgba(255, 255, 255, 0.92);
    --panel-strong: #f7faf9;
    --line: rgba(6, 19, 22, 0.14);
    --text: #0e1a1c;
    --muted: #3e5a5f;
    --brand: #0f9d94;
    --brand-dark: #0a6d68;
    --success: #177d69;
    --warning: #d2872f;
    --danger: #b54040;
    --shadow: 0 16px 40px rgba(10, 29, 33, 0.14);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(15, 157, 148, 0.20), transparent 34%),
        radial-gradient(circle at 90% 10%, rgba(20, 40, 45, 0.11), transparent 28%),
        linear-gradient(145deg, var(--bg) 0%, #f8fbfb 55%, var(--bg-accent) 100%);
}

a {
    color: inherit;
}

.app-shell,
.payment-shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.site-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid rgba(12, 26, 30, 0.18);
    padding: 5px;
}

.site-brand-text {
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
    font-size: clamp(1rem, 2vw, 1.22rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--text);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-theme {
    background:
        radial-gradient(circle at 10% -20%, rgba(15, 157, 148, 0.16), transparent 40%),
        radial-gradient(circle at 95% 0%, rgba(13, 46, 54, 0.12), transparent 35%),
        linear-gradient(160deg, #eef5f6 0%, #f6f9f9 48%, #e8f0f0 100%);
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.admin-brand strong {
    display: block;
    font-size: 1rem;
}

.admin-brand span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-kicker {
    margin-top: 14px;
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 157, 148, 0.12);
    color: var(--brand-dark);
    font-size: 0.84rem;
    font-weight: 700;
}

.admin-login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.admin-theme .hero,
.admin-theme .panel,
.admin-theme .metric-card {
    border-color: rgba(8, 41, 47, 0.18);
}

.admin-theme .metric-card strong {
    letter-spacing: -0.01em;
}

.site-footer {
    margin-top: 28px;
    padding: 24px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 20px;
}

.footer-block h3,
.footer-block h4 {
    margin: 0 0 8px;
}

.footer-block p {
    margin: 0 0 8px;
    color: var(--muted);
    line-height: 1.45;
}

.footer-block a {
    text-decoration: none;
    color: var(--brand-dark);
    font-weight: 600;
}

.footer-block a:hover {
    text-decoration: underline;
}

.footer-meta {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 0.86rem;
}

.hero,
.payment-card,
.panel,
.metric-card,
.flash {
    backdrop-filter: blur(14px);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hero,
.panel,
.payment-card {
    border-radius: var(--radius);
}

.hero {
    display: grid;
    gap: 24px;
    grid-template-columns: 1.4fr 1fr;
    padding: 32px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.public-hero {
    min-height: clamp(360px, 56vw, 520px);
    grid-template-columns: 1.3fr minmax(220px, 340px);
    align-items: end;
}

.public-hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(110deg, rgba(5, 16, 19, 0.72) 2%, rgba(5, 16, 19, 0.30) 46%, rgba(6, 21, 24, 0.62) 100%),
        url('imgs/ja_background.jpg') center/cover no-repeat;
    z-index: 0;
}

.public-hero-copy,
.public-hero-meta {
    position: relative;
    z-index: 1;
}

.public-hero-copy {
    max-width: 640px;
}

.public-hero-copy h1,
.public-hero-copy .hero-copy {
    color: #ffffff;
    text-shadow: 0 8px 30px rgba(0, 0, 0, 0.42);
}

.public-hero-copy h1 {
    line-height: 1.08;
    margin-bottom: 12px;
}

.public-hero-copy .hero-copy {
    margin-bottom: 10px;
}

.public-hero-copy .eyebrow {
    color: #dbfffb;
}

.public-hero-ctas {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.public-hero .metric-card {
    background: rgba(250, 255, 255, 0.90);
    border: 1px solid rgba(11, 63, 70, 0.24);
}

.hero::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -30px;
    width: 240px;
    height: 240px;
    background: url('imgs/ja_logo.png') center/contain no-repeat;
    opacity: 0.08;
    pointer-events: none;
    filter: grayscale(1) contrast(1.1);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--brand-dark);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.eyebrow::before {
    content: none;
}

h1,
h2,
h3,
strong {
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
}

h1 {
    margin: 0;
    font-size: clamp(2.2rem, 4vw, 4.1rem);
    line-height: 0.95;
}

h2,
h3,
p {
    margin-top: 0;
}

.hero-copy,
.panel-heading p,
.metric-label,
.job-meta dt,
.toolbar span,
label span,
.empty-state p,
.payment-summary dt {
    color: var(--muted);
}

.toolbar,
.job-form,
.status-form,
.payment-form {
    display: grid;
    gap: 14px;
}

.toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: end;
}

label,
.checkbox-field {
    display: grid;
    gap: 8px;
    font-size: 0.95rem;
}

input,
select,
textarea,
button,
.button {
    border-radius: 16px;
    border: 1px solid rgba(8, 31, 35, 0.15);
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.82);
}

textarea {
    resize: vertical;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    min-height: 48px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button:hover,
button:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 12px 24px rgba(15, 157, 148, 0.28);
}

.button-secondary {
    background: #e9f3f2;
}

.button-ghost {
    background: transparent;
}

.metrics-grid,
.content-grid {
    display: grid;
    gap: 20px;
}

.metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 24px;
}

.metric-card {
    border-radius: 20px;
    padding: 20px;
}

.metric-card strong {
    display: block;
    margin-top: 10px;
    font-size: 2rem;
}

.content-grid {
    grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
    align-items: start;
}

.panel {
    padding: 24px;
}

.panel-heading,
.job-card-header,
.job-actions,
.payment-link-box,
.form-actions {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
}

.price-chip,
.throughput-chip,
.job-price {
    padding: 12px 14px;
    border-radius: 18px;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    text-align: right;
}

.price-chip span,
.throughput-chip span,
.payment-link-box span {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
}

.job-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 24px;
}

.form-span-2 {
    grid-column: 1 / -1;
}

.checkbox-field {
    grid-template-columns: auto 1fr;
    align-items: center;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
}

.field-error {
    color: var(--danger);
}

.field-note {
    color: var(--muted);
    font-size: 0.8rem;
}

.empty-state {
    padding: 32px;
    text-align: center;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px dashed rgba(11, 49, 54, 0.26);
}

.job-list {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.job-card {
    padding: 20px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
}

.job-card.completed {
    background: rgba(35, 115, 75, 0.08);
}

.job-card.in_progress {
    background: rgba(192, 123, 24, 0.1);
}

.job-time {
    margin-bottom: 6px;
    color: var(--brand-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

.pill-row,
.job-meta,
.payment-summary {
    display: grid;
    gap: 10px;
}

.pill-row {
    grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
    margin: 16px 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    background: #edf5f4;
}

.pill.payment.paid,
.flash-success {
    background: rgba(35, 115, 75, 0.12);
    color: var(--success);
}

.pill.payment.link_sent {
    background: rgba(210, 135, 47, 0.16);
    color: #7f4a06;
}

.pill.payment.not_paid,
.flash-error {
    background: rgba(165, 61, 47, 0.12);
    color: var(--danger);
}

.pill.status.completed {
    background: rgba(35, 115, 75, 0.14);
    color: var(--success);
}

.pill.status.in_progress,
.pill.express {
    background: rgba(210, 135, 47, 0.16);
    color: #7f4a06;
}

.pill.status.en_route {
    background: rgba(49, 89, 153, 0.12);
    color: #315999;
}

.pill.neutral,
.pill.status.scheduled {
    background: #e6f1ef;
}

.job-meta,
.payment-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px 0;
}

.job-meta dt,
.payment-summary dt {
    margin-bottom: 6px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.job-meta dd,
.payment-summary dd {
    margin: 0;
}

.job-actions {
    flex-wrap: wrap;
    align-items: stretch;
    margin-top: 14px;
}

.status-form {
    grid-template-columns: minmax(170px, 1fr) auto;
    align-items: center;
}

.payment-link-box {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    flex-wrap: wrap;
}

.payment-link-box a {
    color: var(--brand-dark);
    overflow-wrap: anywhere;
}

.flash {
    margin-bottom: 20px;
    padding: 14px 18px;
    border-radius: 18px;
}

.payment-shell {
    display: grid;
    place-items: center;
}

.payment-card {
    width: min(560px, 100%);
    padding: 32px;
}

.payment-confirmed {
    color: var(--success);
    font-weight: 700;
}

@media (max-width: 980px) {
    .hero,
    .content-grid,
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .public-hero {
        min-height: clamp(430px, 92vw, 620px);
        align-items: start;
    }

    .site-header {
        flex-direction: column;
        align-items: stretch;
    }

    .site-nav {
        width: 100%;
        flex-direction: column;
    }

    .site-nav .button {
        width: 100%;
    }

    .admin-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-topbar-actions {
        flex-direction: column;
        width: 100%;
    }

    .admin-topbar-actions .button {
        width: 100%;
    }

    .site-footer {
        padding: 18px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .footer-meta {
        flex-direction: column;
    }

    .public-hero-bg {
        background-position: 62% center;
    }

    .public-hero-copy {
        margin-top: 4px;
    }

    .toolbar,
    .job-form,
    .job-meta,
    .payment-summary,
    .status-form {
        grid-template-columns: 1fr;
    }

    .job-actions,
    .panel-heading,
    .job-card-header,
    .payment-link-box,
    .form-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .wizard-progress {
        flex-wrap: wrap;
        gap: 10px;
    }

    .wizard-step-line {
        display: none;
    }

    .wizard-option-grid.two-col {
        grid-template-columns: 1fr;
    }

    .public-hero-ctas {
        width: 100%;
    }

    .public-hero-ctas .button {
        width: 100%;
    }
}

/* ── Quote Wizard ─────────────────────────────────────────────────────────── */

.wizard-shell {
    padding: 32px;
}

.wizard-progress {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 36px;
    overflow: hidden;
}

.wizard-step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.wizard-step-dot span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e8ddd1;
    border: 2px solid var(--line);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.wizard-step-dot label {
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    visibility: hidden;
    gap: 0;
}

.wizard-step-dot.active span,
.wizard-step-dot.done span {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.wizard-step-dot.active label {
    visibility: visible;
    color: var(--brand-dark);
    font-weight: 700;
}

.wizard-step-line {
    flex: 1;
    height: 2px;
    background: var(--line);
    margin-bottom: 22px;
    transition: background 200ms ease;
}

.wizard-step-line.done {
    background: var(--brand);
}

.wizard-step {
    animation: stepIn 220ms ease both;
}

.wizard-step.hidden {
    display: none;
}

@keyframes stepIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wizard-step-heading {
    margin: 0 0 6px;
    font-size: clamp(1.4rem, 3vw, 2rem);
}

.wizard-step-sub {
    color: var(--muted);
    margin-bottom: 24px;
}

.wizard-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.wizard-nav {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 28px;
}

/* Option tiles */
.wizard-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 4px;
}

.wizard-option-grid.two-col {
    grid-template-columns: repeat(2, minmax(0,1fr));
}

.option-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 2px solid var(--line);
    background: rgba(255,255,255,0.7);
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: border-color 150ms ease, background 150ms ease, transform 130ms ease;
}

.option-tile:hover {
    border-color: var(--brand);
    background: rgba(181, 82, 31, 0.06);
    transform: translateY(-2px);
}

.option-tile.selected {
    border-color: var(--brand);
    background: rgba(181, 82, 31, 0.10);
}

.option-tile.large {
    padding: 22px 20px;
}

.option-tile.large strong {
    font-size: 1rem;
    display: block;
}

.option-tile.large span {
    font-size: 0.85rem;
    color: var(--muted);
    display: block;
}

.option-price {
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--brand-dark);
    line-height: 1;
    margin-bottom: 4px;
}

.option-price-free {
    font-size: 1rem;
    color: var(--success);
}

/* Quote summary box */
.quote-summary-box {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 22px 24px;
    margin-bottom: 8px;
}

.quote-rows {
    display: grid;
    gap: 8px;
    margin: 14px 0;
}

.quote-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--muted);
}

.quote-row span:last-child {
    color: var(--text);
    font-weight: 600;
}

.quote-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 1rem;
}

.quote-total-row strong {
    font-size: 1.8rem;
    color: var(--brand-dark);
}

/* ── Address autocomplete dropdown ──────────────────────────────────────── */

.ac-wrap {
    position: relative;
}

.ac-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(68, 40, 17, 0.14);
    overflow: hidden;
    animation: stepIn 150ms ease both;
}

.ac-dropdown[hidden] {
    display: none;
}

.ac-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: none;
    border: none;
    border-radius: 0;
    font: inherit;
    font-size: 0.92rem;
    color: var(--text);
    cursor: pointer;
    border-bottom: 1px solid var(--line);
    min-height: unset;
    transition: background 100ms ease;
}

.ac-item:last-child {
    border-bottom: none;
}

.ac-item:hover,
.ac-item.ac-active {
    background: rgba(181, 82, 31, 0.08);
    transform: none;
    box-shadow: none;
}

.ac-item strong {
    display: block;
    font-size: 0.92rem;
}

.ac-item span {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 2px;
}
