/*
 * Amaze Auto public site (2026-10-18). One design system for every public
 * page: tokens, the shared header / footer (includes/site_layout.php) and
 * components. Class names follow what the pages and assets/js/script.js
 * already use, so restyling did not change their logic. Matches the admin
 * (crs-admin/css/ui.css) and the checkout pages (includes/checkout_layout.php).
 * Replaces assets/css/style.css.
 */

:root {
    --brand: #00748f;
    --brand-dark: #005c72;
    --brand-soft: #e6f3f6;
    --ink: #0f172a;
    --ink-2: #475569;
    --ink-3: #94a3b8;
    --line: #e2e8f0;
    --bg: #f4f6f9;
    --card: #ffffff;
    --ok: #0f9d58;      --ok-soft: #e8f6ee;
    --warn: #b45309;    --warn-soft: #fff7e6;
    --bad: #b91c1c;     --bad-soft: #fef2f2;
    --info: #1d4ed8;    --info-soft: #eff6ff;
    --r-sm: 8px;
    --r: 12px;
    --r-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 4px 16px rgba(15, 23, 42, .08);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Noto Sans TC", "Microsoft JhengHei", Meiryo, Roboto, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); }
img { max-width: 100%; height: auto; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 4vw, 2.25rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid rgba(0, 116, 143, .35); outline-offset: 2px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 760px; }
.main-content, .site-main { min-height: 50vh; }
.section { padding: 48px 0; }
.section-title { text-align: center; margin-bottom: 8px; }
.section-subtitle { text-align: center; color: var(--ink-2); margin: 0 auto 32px; max-width: 640px; }

/* ---------------------------------------------------------------- header */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header-in { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.site-brand { display: flex; align-items: center; flex-shrink: 0; }
.site-brand img { height: 32px; width: auto; display: block; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: var(--r-sm); }
.site-nav a:hover { color: var(--ink); background: #f1f5f9; }
.site-nav a.on { color: var(--brand); background: var(--brand-soft); }
.site-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.site-lang { display: flex; background: #eef1f5; border-radius: 999px; padding: 3px; }
.site-lang a { padding: 5px 10px; border-radius: 999px; font-size: 13px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.site-lang a.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.site-menu-btn { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--ink); cursor: pointer; align-items: center; justify-content: center; }
.site-menu-btn svg { width: 22px; height: 22px; }
@media (max-width: 860px) {
    .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 8px 16px 16px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
    .site-nav.open { display: flex; }
    .site-nav a { padding: 12px; font-size: 16px; }
    .site-menu-btn { display: inline-flex; }
    .site-actions .site-cta { display: none; }
}
@media (max-width: 380px) { .site-lang a { padding: 5px 7px; } .site-brand img { height: 26px; } }

/* ---------------------------------------------------------------- footer */
.site-footer { background: #0f172a; color: #cbd5e1; margin-top: 48px; padding: 40px 0 24px; font-size: 14px; }
.site-footer a { color: #e2e8f0; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer-logo { height: 30px; filter: brightness(0) invert(1); margin-bottom: 12px; }
.site-footer-contact { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.site-footer-contact a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid #334155; border-radius: 999px; color: #e2e8f0; }
.site-footer-contact a:hover { background: #1e293b; text-decoration: none; }
.site-footer-contact svg { width: 16px; height: 16px; }
.site-footer-bottom { border-top: 1px solid #1e293b; margin-top: 32px; padding-top: 16px; color: #94a3b8; font-size: 12px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
@media (max-width: 760px) { .site-footer-grid { grid-template-columns: 1fr 1fr; } .site-footer-grid > :first-child { grid-column: 1 / -1; } }

/* --------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: var(--r); border: 1px solid transparent; font: 600 15px/1.2 var(--font); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; white-space: nowrap; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn-primary, .btn-amazeauto { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover, .btn-amazeauto:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline-primary { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn-secondary, .btn-outline-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover, .btn-outline-secondary:hover { background: #f8fafc; border-color: #cbd5e1; color: var(--ink); }
.btn-link { background: none; border: 0; color: var(--brand); padding-left: 0; padding-right: 0; }
.btn-large, .btn-lg { min-height: 52px; padding: 12px 24px; font-size: 16px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: var(--r-sm); }
.btn-block, .w-100 { width: 100%; }

/* ---------------------------------------------------------------- cards */
.card, .booking-section, .booking-card, .login-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card { margin-bottom: 16px; overflow: hidden; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--line); background: #f8fafc; font-weight: 600; }
.card-header h1, .card-header h2, .card-header h3, .card-header h4, .card-header h5 { margin: 0; font-size: 1rem; }
.card-body { padding: 20px; }
.card-title { font-size: 1.05rem; margin-bottom: 8px; }
.booking-section { padding: 24px; margin-bottom: 16px; }
.booking-section > h2, .booking-section > h3 { font-size: 1.15rem; margin-bottom: 16px; }

/* ---------------------------------------------------------------- forms */
.form-group { margin-bottom: 16px; }
label, .form-label { display: block; font-weight: 600; font-size: 14px; color: var(--ink); margin-bottom: 6px; }
.form-control, input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=password], select, textarea {
    width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: var(--r); background: #fff; color: var(--ink); font: 16px/1.4 var(--font); appearance: none; -webkit-appearance: none; }
textarea, textarea.form-control { min-height: 110px; resize: vertical; }
select, select.form-control { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 38px; }
.form-control:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 116, 143, .18); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--brand); }
.form-control-lg { min-height: 54px; font-size: 18px; }
.form-text, .form-notice, small.text-muted { display: block; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.form-row { display: grid; gap: 16px; }
.form-row.two-cols { grid-template-columns: 1fr 1fr; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 560px) { .form-row.two-cols { grid-template-columns: 1fr; gap: 0; } }

/* ---------------------------------------------------------------- alerts / badges */
.alert { padding: 12px 16px; border-radius: var(--r); border: 1px solid transparent; margin-bottom: 16px; font-size: 15px; }
.alert-success { background: var(--ok-soft); color: #065f46; border-color: #bbf7d0; }
.alert-info { background: var(--info-soft); color: var(--info); border-color: #bfdbfe; }
.alert-danger, .alert-error { background: var(--bad-soft); color: var(--bad); border-color: #fecaca; }
.alert-warning { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }
.alert-light { background: #f8fafc; color: var(--ink-2); border-color: var(--line); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef1f5; color: var(--ink-2); }
.badge-success, .bg-success { background: var(--ok-soft); color: #065f46; }
.badge-danger, .bg-danger { background: var(--bad-soft); color: var(--bad); }
.bg-warning { background: var(--warn-soft); color: var(--warn); }
.bg-info { background: var(--info-soft); color: var(--info); }
.bg-light { background: #f8fafc; }

/* ---------------------------------------------------------------- tables */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 13px; color: var(--ink-2); font-weight: 600; background: #f8fafc; }
.table-sm th, .table-sm td { padding: 8px 10px; }
.table-hover tbody tr:hover { background: #f8fafc; }
.table-light th, .table-dark th { background: #f1f5f9; color: var(--ink-2); }

/* ---------------------------------------------------------------- hero + search */
.hero { background: linear-gradient(160deg, #00748f 0%, #00566b 100%); color: #fff; padding: 56px 0 96px; text-align: center; }
.hero h1 { color: #fff; margin-bottom: 8px; }
.hero p { color: rgba(255, 255, 255, .85); font-size: 1.05rem; margin: 0; }
.search-section { position: relative; max-width: 760px; margin: -64px auto 0; background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 8px 24px 24px; z-index: 2; }
.search-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -8px 20px; }
.search-tab { flex: 1; background: none; border: 0; border-bottom: 3px solid transparent; padding: 14px 8px; font: 600 15px var(--font); color: var(--ink-2); cursor: pointer; }
.search-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.search-content { display: none; }
.search-content.active { display: block; }
@media (max-width: 560px) { .hero { padding: 36px 0 80px; } .search-section { margin: -56px 16px 0; padding: 4px 16px 20px; } }

/* ---------------------------------------------------------------- vehicles */
/* auto-fit + a max width, centred: two cars sit in the middle instead of leaving the right side empty */
.vehicles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 360px)); justify-content: center; gap: 20px; }
@media (max-width: 620px) { .vehicles-grid { grid-template-columns: minmax(0, 1fr); } }
.vehicle-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.vehicle-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.vehicle-image { aspect-ratio: 3 / 2; background: #eef1f5; display: grid; place-items: center; overflow: hidden; }
.vehicle-image img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-info { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.vehicle-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.vehicle-title { font-size: 1.1rem; margin: 0; }
.vehicle-title a { color: inherit; text-decoration: none; }
.vehicle-title a:hover { color: var(--brand); }
a.vehicle-image { display: grid; }
.vehicle-year { color: var(--ink-3); font-size: 13px; }
.vehicle-details { display: flex; flex-wrap: wrap; gap: 6px; }
.vehicle-detail { font-size: 13px; color: var(--ink-2); background: #f1f5f9; border-radius: 999px; padding: 3px 10px; }
.vehicle-price { margin-top: auto; font-size: 1.35rem; font-weight: 800; color: var(--ink); }
.vehicle-price small, .price-period { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.vehicle-card .btn { width: 100%; }

/* ---------------------------------------------------------------- booking funnel */
.booking-progress { display: flex; justify-content: center; gap: 0; max-width: 640px; margin: 0 auto; }
.progress-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; text-align: center; }
.progress-step:not(:last-child)::after { content: ""; position: absolute; top: 15px; left: calc(50% + 20px); right: calc(-50% + 20px); height: 2px; background: var(--line); }
.progress-step.completed:not(:last-child)::after { background: var(--brand); }
.step-number { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--line); color: var(--ink-3); font-weight: 700; font-size: 14px; position: relative; z-index: 1; }
.progress-step.active .step-number { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.progress-step.completed .step-number { background: var(--brand); border-color: var(--brand); color: #fff; }
.step-label { font-size: 12px; color: var(--ink-2); line-height: 1.3; }
.progress-step.active .step-label { color: var(--ink); font-weight: 600; }
.booking-container { max-width: 760px; margin: 0 auto; }
.summary-details { display: grid; }
.summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.summary-row:last-child { border-bottom: 0; }
.summary-label { color: var(--ink-2); font-size: 14px; }
.summary-value { font-weight: 600; text-align: right; }
.total-amount { font-size: 1.4rem; font-weight: 800; color: var(--ink); }
.payment-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.payment-option { position: relative; }
.payment-option input { position: absolute; opacity: 0; pointer-events: none; }
.payment-option-label { display: block; height: 100%; padding: 16px; border: 1.5px solid var(--line); border-radius: var(--r); cursor: pointer; background: #fff; margin: 0; font-weight: 400; }
.payment-option input:checked + .payment-option-label { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.payment-option-content h4 { margin: 0 0 4px; font-size: 15px; }
.payment-amount { font-size: 1.35rem; font-weight: 800; margin: 0 0 4px; color: var(--ink); }
.payment-description { margin: 0; font-size: 13px; color: var(--ink-2); }
.booking-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 560px) { .payment-options { grid-template-columns: 1fr; } .booking-section { padding: 18px; } .step-label { font-size: 11px; } }

/* ---------------------------------------------------------------- text pages */
.page-content { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px; max-width: 820px; margin: 0 auto; line-height: 1.8; }
.page-content h1 { margin-bottom: 1rem; }
.page-content h2 { margin: 2rem 0 .75rem; font-size: 1.25rem; }
.page-content ul { padding-left: 1.4rem; }
.page-content table { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; }
.page-content th, .page-content td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.page-updated { color: var(--ink-3); font-size: .9rem; margin-top: 2rem; }
@media (max-width: 560px) { .page-content { padding: 20px; border-radius: var(--r); } }

/* ---------------------------------------------------------------- misc */
.loading { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
.btn-outline-primary .loading, .btn-secondary .loading { border-color: var(--brand-soft); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 40px 16px; color: var(--ink-2); }
.empty-state h3 { color: var(--ink); }
.mono { font-family: var(--mono); }

/* small utility set (portal pages) */
.text-center { text-align: center; } .text-end, .text-right { text-align: right; }
.text-muted { color: var(--ink-2) !important; } .text-primary { color: var(--brand) !important; }
.text-success { color: var(--ok) !important; } .text-danger { color: var(--bad) !important; } .text-warning { color: var(--warn) !important; }
.small, small { font-size: 13px; } .fw-bold, .strong { font-weight: 700; }
.d-none { display: none !important; } .d-flex { display: flex; } .d-grid { display: grid; } .flex-wrap { flex-wrap: wrap; } .flex-grow-1 { flex-grow: 1; }
.align-items-center { align-items: center; } .justify-content-between { justify-content: space-between; } .justify-content-center { justify-content: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 16px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; } .me-1 { margin-right: 4px; } .me-2 { margin-right: 8px; } .ms-2 { margin-left: 8px; }
.py-4 { padding-top: 24px; padding-bottom: 24px; } .p-4 { padding: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

@media print {
    .site-header, .site-footer, .booking-actions, .btn, .no-print, .d-print-none { display: none !important; }
    body { background: #fff; }
    .card, .booking-section, .page-content { border: 0; box-shadow: none; }
}
