/* ============================================================================
   MilesEscrow — site.css
   ----------------------------------------------------------------------------
   Public shell styling. Bootstrap 5 does the layout; this file adds the brand
   layer: a blue/teal fintech palette, the sticky header, the hero, the listing
   cards and the toast host.

   DESIGN TOKENS
     Every colour is a variable so the palette can be re-themed in one place and
     so contrast can be audited without hunting hex literals.

   ACCESSIBILITY
     • Focus rings are never removed, only restyled.
     • Text on the teal and blue surfaces is checked for 4.5:1.
     • The skip link is the first focusable element in the DOM.

   PRINT
     Print rules live in print.css; nothing here assumes a medium.
   ============================================================================ */

:root {
    /* brand */
    --me-blue-900: #072f43;
    --me-blue-700: #0b4f6c;
    --me-blue-500: #16789f;
    --me-teal-500: #12a3a3;
    --me-teal-300: #6fd3d3;

    /* neutrals */
    --me-ink: #11212b;
    --me-ink-muted: #5a6b76;
    --me-line: #e2e8ec;
    --me-surface: #ffffff;
    --me-surface-alt: #f6f9fa;

    /* semantic */
    --me-success: #157347;
    --me-warning: #9a6700;
    --me-danger: #b02a37;

    /* spacing rhythm */
    --me-radius: 0.75rem;
    --me-radius-sm: 0.5rem;
    --me-shadow: 0 1px 2px rgba(17, 33, 43, .06), 0 8px 24px rgba(17, 33, 43, .06);
    --me-shadow-lg: 0 4px 12px rgba(17, 33, 43, .08), 0 24px 48px rgba(17, 33, 43, .10);
}

/* ---------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------- */
body {
    color: var(--me-ink);
    background: var(--me-surface);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--me-blue-700); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--me-blue-500); }

h1, h2, h3, h4 { letter-spacing: -0.015em; }

/* Never remove a focus ring: restyle it so it is visible on both surfaces. */
:focus-visible {
    outline: 3px solid var(--me-teal-500);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    left: 0.75rem;
    top: -3rem;
    z-index: 1080;
    background: var(--me-blue-700);
    color: #fff;
    padding: 0.5rem 0.9rem;
    border-radius: 0 var(--me-radius-sm) var(--me-radius-sm) var(--me-radius-sm);
    transition: top .15s ease-in-out;
}

.skip-link:focus { top: 0.75rem; color: #fff; }

/* ---------------------------------------------------------------------------
   Header
   --------------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 1030; backdrop-filter: saturate(180%) blur(6px); }

.site-header .navbar-brand span { color: var(--me-blue-900); }

.site-header .nav-link {
    color: var(--me-ink-muted);
    font-weight: 500;
    padding: 0.5rem 0.85rem;
    border-radius: var(--me-radius-sm);
}

.site-header .nav-link:hover,
.site-header .nav-link:focus { color: var(--me-blue-700); background: var(--me-surface-alt); }

.site-header .nav-link[aria-current="page"] {
    color: var(--me-blue-700);
    background: rgba(18, 163, 163, .10);
}

/* ---------------------------------------------------------------------------
   Main content and section rhythm
   --------------------------------------------------------------------------- */
.site-main { min-height: 60vh; }

.section { padding: 3.5rem 0; }
.section-tight { padding: 2rem 0; }
.section-alt { background: var(--me-surface-alt); }

.section-eyebrow {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .75rem;
    font-weight: 600;
    color: var(--me-teal-500);
}

/* ---------------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------------- */
.hero {
    background: linear-gradient(135deg, var(--me-blue-900) 0%, var(--me-blue-700) 55%, var(--me-teal-500) 130%);
    color: #fff;
    padding: 4.5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 80% 10%, rgba(111, 211, 211, .25), transparent 45%);
    pointer-events: none;
}

.hero h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; line-height: 1.15; }

.hero .lead { color: rgba(255, 255, 255, .88); max-width: 40rem; }

.hero .btn-primary {
    background: #fff;
    color: var(--me-blue-900);
    border-color: #fff;
    font-weight: 600;
}

.hero .btn-primary:hover { background: var(--me-teal-300); border-color: var(--me-teal-300); color: var(--me-blue-900); }

.hero .btn-outline-light { border-width: 2px; font-weight: 600; }

/* ---------------------------------------------------------------------------
   Trust badges
   --------------------------------------------------------------------------- */
.trust-badge {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem;
    border: 1px solid var(--me-line);
    border-radius: var(--me-radius);
    background: var(--me-surface);
    height: 100%;
}

.trust-badge .bi { color: var(--me-teal-500); font-size: 1.35rem; line-height: 1; }

/* ---------------------------------------------------------------------------
   Listing cards
   --------------------------------------------------------------------------- */
.listing-card {
    border: 1px solid var(--me-line);
    border-radius: var(--me-radius);
    background: var(--me-surface);
    box-shadow: var(--me-shadow);
    height: 100%;
    transition: transform .15s ease, box-shadow .15s ease;
    overflow: hidden;
}

.listing-card:hover { transform: translateY(-2px); box-shadow: var(--me-shadow-lg); }

.listing-card:focus-within { outline: 3px solid var(--me-teal-300); outline-offset: 2px; }

.listing-card__head {
    padding: .9rem 1rem .6rem;
    border-bottom: 1px solid var(--me-line);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .5rem;
}

.listing-card__program { font-weight: 600; line-height: 1.2; }

.listing-card__airline { font-size: .8rem; color: var(--me-ink-muted); }

.listing-card__body { padding: 1rem; }

.listing-card__price { font-size: 1.35rem; font-weight: 700; color: var(--me-blue-700); }

.listing-card__price small { font-size: .8rem; font-weight: 500; color: var(--me-ink-muted); }

.listing-card__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem .75rem;
    font-size: .85rem;
    color: var(--me-ink-muted);
    margin-top: .75rem;
}

.listing-card__meta strong { color: var(--me-ink); font-weight: 600; }

.listing-card__foot {
    padding: .75rem 1rem;
    border-top: 1px solid var(--me-line);
    background: var(--me-surface-alt);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
}

/* ---------------------------------------------------------------------------
   Pager
   --------------------------------------------------------------------------- */
.me-pager { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }

.me-pager .page-link {
    border: 1px solid var(--me-line);
    border-radius: var(--me-radius-sm);
    color: var(--me-blue-700);
    min-width: 2.5rem;
    text-align: center;
}

.me-pager .page-link:hover { background: var(--me-surface-alt); }

.me-pager .active .page-link {
    background: var(--me-blue-700);
    border-color: var(--me-blue-700);
    color: #fff;
    font-weight: 600;
}

.me-pager .disabled .page-link { color: #adb5bd; pointer-events: none; }

/* ---------------------------------------------------------------------------
   Toasts
   --------------------------------------------------------------------------- */
.toast-host {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1080;
    max-width: min(24rem, calc(100vw - 2rem));
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.toast-host:empty { display: none; }

.toast-host .alert { margin-bottom: 0; }

/* ---------------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------------- */
.form-label { font-weight: 500; font-size: .9rem; }

.form-control, .form-select { border-color: #cfd8dd; }

.form-control:focus, .form-select:focus {
    border-color: var(--me-teal-500);
    box-shadow: 0 0 0 .2rem rgba(18, 163, 163, .20);
}

.form-text { font-size: .8rem; }

.invalid-feedback { font-size: .82rem; }

/* ---------------------------------------------------------------------------
   Empty and loading states
   --------------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    border: 1px dashed var(--me-line);
    border-radius: var(--me-radius);
    background: var(--me-surface-alt);
    color: var(--me-ink-muted);
}

.empty-state .bi { font-size: 2rem; color: var(--me-teal-300); display: block; margin-bottom: .75rem; }

.is-loading { position: relative; pointer-events: none; opacity: .6; }

.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .5);
    border-radius: inherit;
}

/* ---------------------------------------------------------------------------
   Badges and status pills
   --------------------------------------------------------------------------- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .01em;
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
.site-footer { background: var(--me-surface-alt); }

.site-footer a { color: var(--me-ink-muted); }

.site-footer a:hover { color: var(--me-blue-700); }

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .section { padding: 2.25rem 0; }
    .hero { padding: 3rem 0 2.5rem; }
    .listing-card__meta { grid-template-columns: 1fr; }
    .toast-host { left: 1rem; right: 1rem; max-width: none; }
}

/* Respect the OS "reduce motion" preference rather than animating regardless. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
