/*
    mobile_wizard.css
    Scoped styles for mobile/model_mobile.cfm gauge search wizard.
    Does not affect any other page.
*/

:root {
    --mw-bg:              #fdfdff;
    --mw-surface:         #ffffff;
    --mw-border:          #cccccc;
    --mw-text:            #222222;
    --mw-navy:            #000080;
    --mw-navy-dark:       #000040;
    --mw-accent:          #CEE6FB;
    --mw-muted:           #666666;
    --mw-chip-bg:         #e8ecf5;
    --mw-chip-active:     #000080;
    --mw-chip-active-text:#ffffff;
    --mw-error-bg:        #fff3cd;
    --mw-error-border:    #ffc107;
    --mw-tile-hover:      #d0e8f8;
}

/* ── Base ──────────────────────────────────────────────────────────────── */
html, body {
    margin: 0;
    padding: 0;
    background: var(--mw-bg);
    color: var(--mw-text);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body, .wizard-container, .tile, .chip, .bottom-bar {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Bottom-bar height clearance so content isn't hidden */
body {
    padding-bottom: 80px;
}

/* ── Container ─────────────────────────────────────────────────────────── */
.wizard-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 16px 8px;
}

/* ── Resume notice (bookmarked-step fallback) ──────────────────────────── */
.resume-notice {
    background: var(--mw-error-bg);
    border: 1px solid var(--mw-error-border);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.95em;
}

/* ── Headings ──────────────────────────────────────────────────────────── */
h1.wizard-title {
    font-size: 1.25em;
    font-weight: bold;
    color: var(--mw-navy);
    margin: 0 0 4px;
}

h2.step-title {
    font-size: 1.05em;
    font-weight: bold;
    color: var(--mw-navy-dark);
    margin: 6px 0 12px;
}

/* ── Breadcrumb chips ──────────────────────────────────────────────────── */
.breadcrumb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    padding: 0;
    list-style: none;
}

.chip {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 16px;
    background: var(--mw-chip-bg);
    color: var(--mw-navy);
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #c0ccde;
    line-height: 1.4;
}

.chip:hover, .chip:focus {
    background: #c8d8ef;
    outline: 2px solid var(--mw-navy);
    outline-offset: 1px;
}

.chip[aria-current="step"] {
    background: var(--mw-chip-active);
    color: var(--mw-chip-active-text);
    border-color: var(--mw-navy-dark);
    cursor: default;
    pointer-events: none;
}

/* ── Tile grid ─────────────────────────────────────────────────────────── */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 4px;
}

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    padding: 14px 12px;
    background: var(--mw-surface);
    border: 2px solid var(--mw-navy);
    border-radius: 8px;
    color: var(--mw-navy);
    font-size: 1.05em;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    line-height: 1.3;
    transition: background 0.15s, border-color 0.15s;
    box-sizing: border-box;
}

.tile:hover, .tile:focus {
    background: var(--mw-tile-hover);
    border-color: var(--mw-navy-dark);
    outline: none;
}

.tile:focus-visible {
    outline: 3px solid var(--mw-navy);
    outline-offset: 2px;
}

.tile-count {
    font-size: 0.75em;
    font-weight: normal;
    color: var(--mw-muted);
    margin-top: 4px;
}

/* ── Empty state / error ───────────────────────────────────────────────── */
.empty-state {
    background: var(--mw-error-bg);
    border: 1px solid var(--mw-error-border);
    border-radius: 6px;
    padding: 16px;
    margin-top: 8px;
}

.empty-state p {
    margin: 0 0 12px;
}

.empty-state a {
    color: var(--mw-navy);
    font-weight: bold;
    text-decoration: underline;
    margin-right: 14px;
}

/* ── Sticky bottom bar ─────────────────────────────────────────────────── */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--mw-surface);
    border-top: 1px solid var(--mw-border);
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.bottom-bar a,
.bottom-bar span.step-indicator {
    font-size: 0.9em;
    color: var(--mw-navy);
    text-decoration: none;
    white-space: nowrap;
}

/* True-center the step indicator regardless of side element widths */
.bottom-bar > a:first-child,
.bottom-bar > .classic-link {
    flex: 1;
}
.bottom-bar > a:first-child {
    text-align: left;
}
.bottom-bar > .classic-link {
    text-align: right;
}

.bottom-bar a:hover,
.bottom-bar a:focus {
    text-decoration: underline;
    outline: 2px solid var(--mw-navy);
    outline-offset: 2px;
    border-radius: 2px;
}

.bottom-bar .step-indicator {
    font-weight: bold;
    color: var(--mw-muted);
    flex-shrink: 0;
    margin: 0 8px;
    text-align: center;
}

.bottom-bar .classic-link {
    font-size: 0.82em;
    color: var(--mw-muted);
    text-align: right;
}

/* ── Results view ─────────────────────────────────────────────────────── */
.results-summary {
    font-size: 0.88em;
    color: #333;
    padding: 6px 0 12px;
    line-height: 1.7;
}

.results-count {
    font-weight: bold;
    color: var(--mw-navy);
}

.results-heading {
    font-size: 1.05em;
    font-weight: bold;
    color: var(--mw-navy);
    margin: 0 0 10px;
}

.results-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 16px;
}

.results-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 0.85em;
}

.results-table th {
    background: #D4D4D4;
    padding: 5px 8px;
    text-align: center;
    border: 1px solid #bbb;
    font-size: 0.88em;
    white-space: nowrap;
}

.results-table td {
    background: #DCEDFC;
    padding: 4px 8px;
    text-align: center;
    border: 1px solid #ccc;
    vertical-align: top;
}

.results-table a {
    color: var(--mw-navy);
    text-decoration: underline;
}

.results-table a:hover,
.results-table a:focus {
    text-decoration: none;
}

.surcharge-note {
    background: #FFF9E6;
    border: 1px solid #FFCC00;
    border-radius: 4px;
    padding: 12px 14px;
    margin: 16px 0 8px;
    font-size: 0.8em;
    color: maroon;
    line-height: 1.5;
}

.notice-box {
    background: #FFF9E6;
    border: 1px solid #FFCC00;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 16px;
    font-size: 11px;
    color: maroon;
    line-height: 1.4;
}

.results-btn-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.results-startover {
    display: inline-block;
    padding: 8px 18px;
    border: 2px solid var(--mw-navy);
    color: var(--mw-navy);
    font-weight: bold;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
}

.results-startover:hover,
.results-startover:focus {
    background: var(--mw-accent);
    outline: 2px solid var(--mw-navy);
    outline-offset: 2px;
    text-decoration: none;
}
