/* MileLog – Vehicle Maintenance Reminder Calculator
   Clean garage-workshop visual direction */

:root {
    --bg: #faf8f5;
    --surface: #ffffff;
    --border: #e0dcd5;
    --text: #2c2416;
    --text-secondary: #6b5e4a;
    --accent: #c7510f;
    --accent-hover: #a8430b;
    --accent-light: #fdf0e6;
    --green: #2d6a4f;
    --green-bg: #edf7f1;
    --yellow: #b8860b;
    --yellow-bg: #fef9e7;
    --red: #b91c1c;
    --red-bg: #fef2f2;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo svg {
    color: var(--accent);
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.15s;
}

.main-nav a:hover {
    color: var(--accent);
}

/* Main */
main {
    flex: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
    width: 100%;
}

/* Hero */
.hero-section {
    text-align: center;
    padding: 2rem 0 1.5rem;
}

.hero-section h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Section titles */
.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}

/* Tracker section */
.tracker-section {
    margin-bottom: 2.5rem;
}

.vehicle-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.vehicle-selector {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.vehicle-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s;
    white-space: nowrap;
}

.vehicle-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.vehicle-tab:hover:not(.active) {
    border-color: var(--accent);
    color: var(--accent);
}

/* Tracker card */
.tracker-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.vehicle-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 520px) {
    .vehicle-info-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--font);
    background: var(--bg);
    transition: border-color 0.15s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* Presets */
.service-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.preset-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 0.25rem;
}

.preset-chip {
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    transition: all 0.15s;
    white-space: nowrap;
}

.preset-chip:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

/* Custom service row */
.custom-service-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
}

.form-group-sm {
    flex: 1;
    min-width: 120px;
}

.form-group-sm label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.2rem;
}

.form-group-sm input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font);
    background: var(--surface);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
    font-family: var(--font);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-outline {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
}

/* Service list */
.service-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.service-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 0.5fr;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .service-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }
}

.service-row .service-name {
    font-weight: 600;
    color: var(--text);
}

.service-row input {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font);
    background: var(--surface);
    width: 100%;
}

.service-row .due-badge {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    text-align: center;
}

.due-badge.overdue {
    background: var(--red-bg);
    color: var(--red);
}

.due-badge.soon {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.due-badge.ok {
    background: var(--green-bg);
    color: var(--green);
}

.service-row .remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 0.2rem;
    line-height: 1;
}

.service-row .remove-btn:hover {
    color: var(--red);
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Card actions */
.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.save-feedback {
    font-size: 0.85rem;
    color: var(--green);
    font-weight: 500;
    margin-top: 0.5rem;
    min-height: 1.2em;
}

/* Garage */
.garage-panel {
    margin-top: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.garage-heading {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.garage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.garage-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    background: var(--bg);
    cursor: pointer;
    transition: all 0.15s;
}

.garage-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.garage-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.garage-card .garage-mileage {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.garage-card .garage-next {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

.garage-empty {
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-align: center;
    padding: 1rem;
}

/* Support sections */
.support-section {
    margin-top: 2.5rem;
}

/* Scenario steps */
.scenario-steps {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.step-content h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.step-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Reference table */
.table-wrapper {
    overflow-x: auto;
}

.reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.reference-table th,
.reference-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.reference-table th {
    background: var(--bg);
    font-weight: 700;
    color: var(--text);
    font-size: 0.85rem;
}

.reference-table td {
    color: var(--text-secondary);
}

.reference-table tbody tr:hover {
    background: var(--accent-light);
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.faq-item summary {
    padding: 0.85rem 1rem;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    float: right;
    font-size: 1.2rem;
    color: var(--accent);
    transition: transform 0.2s;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item p {
    padding: 0 1rem 0.85rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Footer */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem 1.25rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-inner a {
    color: var(--accent);
    text-decoration: none;
}

.footer-inner a:hover {
    text-decoration: underline;
}

.footer-note {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

/* Print styles */
@media print {
    .site-header, .site-footer, .vehicle-bar, .service-presets, .custom-service-row,
    .card-actions, .garage-panel, .support-section, .save-feedback, .remove-btn,
    .empty-state {
        display: none !important;
    }
    body {
        background: #fff;
        font-size: 12px;
    }
    .tracker-card {
        box-shadow: none;
        border: none;
        padding: 0;
    }
    .service-row {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
