/* ============================================================
   CRITICAL above-the-fold CSS - extracted from site.css (v7).
   Loaded render-blocking on marketing pages while the full
   site.css loads async. The FULL site.css still contains every
   rule below, so any drift self-heals the moment it arrives -
   keep this file a straight copy of those site.css sections.
   Sections: :root vars, reset/base, mobile-first globals,
   typography, skip-link, container, menu backdrop, hamburger,
   header, nav, main padding, mobile bottom CTA, hero, trust
   badges, global buttons.
   ============================================================ */
﻿/* CSS Variables */
:root {
    --primary: var(--ari-blue);
    --primary-dark: #00264D; /* darker blue for gradients/hover */
    --bg-gray: var(--ari-gray);
    --border: var(--ari-light-gray);
    --text: var(--ari-dark-gray);
    --ari-red: #CC0000;
    --ari-blue: #003366;
    --ari-dark-blue: #00264D; /* Ported from gold: mobile-first */
    --ari-light-blue: #0066CC;
    --ari-green: #10b981; /* Ported from gold: mobile-first */
    --ari-white: #FFFFFF;
    --ari-gray: #F5F5F5;
    --ari-dark-gray: #333333;
    --ari-light-gray: #E0E0E0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;

    /* Admin Color Palette - Harmonized */
    --admin-primary: #667eea;
    --admin-primary-dark: #5a6fd6;

    /* Status Colors */
    --status-success: #27ae60;
    --status-success-bg: #d4edda;
    --status-success-text: #155724;

    --status-warning: #f39c12;
    --status-warning-bg: #fff3cd;
    --status-warning-text: #856404;

    --status-danger: #e74c3c;
    --status-danger-bg: #f8d7da;
    --status-danger-text: #721c24;

    --status-info: #3498db;
    --status-info-bg: #d1ecf1;
    --status-info-text: #0c5460;

    --status-pending: #f39c12;
    --status-pending-bg: #fff3cd;
    --status-pending-text: #856404;

    /* Priority Colors */
    --priority-hot: #e74c3c;
    --priority-warm: #f39c12;
    --priority-cold: #3498db;

    /* Application Type Colors */
    --type-owner: #2e7d32;
    --type-owner-bg: #e8f5e9;
    --type-fleet: #e65100;
    --type-fleet-bg: #fff3e0;
    --type-driver: #1565c0;
    --type-driver-bg: #e3f2fd;

    /* Neutral */
    --neutral-100: #f8f9fa;
    --neutral-200: #e9ecef;
    --neutral-300: #dee2e6;
    --neutral-400: #ced4da;
    --neutral-500: #adb5bd;
    --neutral-600: #6c757d;
    --neutral-700: #495057;
    --neutral-800: #343a40;
    --neutral-900: #212529;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--ari-dark-gray);
    background: var(--ari-white);
    overflow-x: hidden;
}

/* Ported from gold: mobile-first — Utility Classes */
/* Visually hidden but accessible to screen readers */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Touch-friendly minimum tap target (44x44px per Apple HIG) */
.touch-target {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Ported from gold: mobile-first — global mobile improvements */
@media (max-width: 576px) {
    /* Ensure all buttons are touch-friendly */
    .btn {
        min-height: 44px;
        padding: 0.625rem 1rem;
    }

    .btn-sm {
        min-height: 38px;
        padding: 0.5rem 0.75rem;
    }

    /* Wizard row-action buttons meet 44px tap minimum on mobile */
    .summary-card .btn-edit,
    .summary-card .btn-remove,
    .truck-summary-card .btn-edit,
    .truck-summary-card .btn-remove,
    .trailer-summary-card .btn-edit,
    .trailer-summary-card .btn-remove,
    .accident-summary-card .btn-edit,
    .accident-summary-card .btn-remove,
    .violation-summary-card .btn-edit,
    .violation-summary-card .btn-remove,
    .address-display-card .btn-edit,
    .address-display-card .btn-remove,
    .driver-summary-card .btn-edit,
    .driver-summary-card .btn-resend {
        min-height: 44px;
        min-width: 44px;
    }

    /* Form actions stack on mobile */
    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    /* Yes/No toggles wrap on small screens */
    .yes-no-toggle,
    .btn-group-toggle {
        flex-wrap: wrap;
    }

    /* Critical: prevents iOS zoom on focus */
    input,
    textarea,
    select {
        font-size: 16px !important;
    }

    /* Max-width utilities become full width on mobile */
    .max-w-150,
    .max-w-200,
    .max-w-400 {
        max-width: 100% !important;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--ari-blue);
}

h1 {
    font-size: clamp(1.75rem, 4vw, 3.5rem);
}

h2 {
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.875rem);
}

h4 {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
}

p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

a {
    color: var(--ari-light-blue);
    text-decoration: none;
    transition: var(--transition);
}

    a:hover {
        color: var(--ari-red);
    }

/* Skip to Content Link - Accessibility (WCAG 2.1 - 2.4.1) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--ari-blue);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    z-index: 10000;
    font-weight: bold;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--ari-red);
    outline-offset: 2px;
    color: white;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    overflow-x: hidden;
}

/* Backdrop for mobile menu */
.menu-backdrop {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
    display: none; /* JS-driven: shown via .show when the mobile menu opens (static-SSR safe) */
}

    .menu-backdrop.show {
        display: block;
    }

/* Hamburger <-> close icon swap, toggled by JS adding .open to the button */
.mobile-menu-btn .menu-icon-close {
    display: none;
}

.mobile-menu-btn.open .menu-icon-open {
    display: none;
}

.mobile-menu-btn.open .menu-icon-close {
    display: inline;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text);
    z-index: 1001;
}

.logo-icon {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    display: none;
    color: var(--text);
}

@media (min-width: 640px) {
    .logo-text {
        display: block;
    }
}

.mobile-header-phone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    background: var(--bg-gray);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    font-size: 0.875rem;
    white-space: nowrap;
}

    .mobile-header-phone:hover {
        background: white;
        border-color: var(--primary);
    }

    .mobile-header-phone:active {
        transform: scale(0.98);
    }

.mobile-phone-icon {
    font-size: 1.125rem;
}

.mobile-phone-text {
    display: inline;
}

@media (min-width: 1024px) {
    .mobile-header-phone {
        display: none;
    }
}

@media (max-width: 380px) {
    .mobile-phone-text {
        display: none;
    }
}

.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 2px solid var(--border);
    border-radius: 8px;
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    transition: all 0.3s ease;
    z-index: 1001;
    position: relative;
}

    .mobile-menu-btn:hover {
        border-color: var(--primary);
        background: var(--bg-gray);
    }

    .mobile-menu-btn:active {
        transform: scale(0.95);
    }

@media (min-width: 1024px) {
    .mobile-menu-btn {
        display: none;
    }
}

/* Nav */
.nav {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 90%;
    max-width: 320px;
    height: calc(100vh - 70px);
    height: calc(100dvh - 70px); /* Ported from gold: mobile-first */
    background: white;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom)); /* Ported from gold: mobile-first */
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
    z-index: 1001;
}

    .nav.open {
        left: 0 !important;
    }

    .nav a {
        display: flex;
        align-items: center;
        padding: 1rem 1.5rem;
        color: var(--text);
        text-decoration: none;
        font-weight: 500;
        font-size: 1rem;
        border-bottom: 1px solid var(--border);
        transition: background 0.2s ease;
        min-height: 56px;
    }

        .nav a:hover {
            background: var(--bg-gray);
            color: var(--primary);
        }

.nav-footer {
    padding: 0.75rem 1.5rem;
    background: white;
    display: none;
}

.nav-logo-bottom {
    text-align: center;
    display: block;
}

    .nav-logo-bottom img {
        display: inline-block;
        height: 230px;
        width: auto;
        opacity: 0.95;
        transition: var(--transition);
        pointer-events: none;
        user-select: none;
    }

@media (max-width: 1023.98px) {
    .nav.open .nav-footer {
        display: block;
    }
}

@media (min-width: 1024px) {
    .nav-footer {
        display: none !important;
    }
}

.nav-contact {
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--border);
}

.nav-phone {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem !important;
    background: var(--bg-gray);
    border-radius: 8px;
    border: none !important;
    color: var(--primary) !important;
    font-weight: 600;
}

.phone-icon {
    font-size: 1.25rem;
}

.phone-number {
    font-size: 1.125rem;
}

.nav-apply-btn {
    margin: 1rem 1.5rem !important;
    padding: 0.875rem 1.5rem !important;
    background: linear-gradient(135deg, var(--ari-red), #FF0000) !important;
    color: white !important;
    border-radius: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9375rem;
    border: none !important;
    min-height: 48px !important;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

    .nav-apply-btn:hover {
        background: linear-gradient(135deg, #B80000, #B80000) !important;
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(30, 64, 175, 0.3);
        color: white !important;
    }

@media (min-width: 1024px) {
    .nav {
        position: static;
        left: auto;
        width: auto;
        max-width: none;
        height: auto;
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
        padding: 0;
        box-shadow: none;
        overflow: visible;
    }

        .nav a {
            padding: 0.5rem 1rem;
            border: none;
            min-height: auto;
        }

    .nav-contact {
        padding: 0;
        border: none;
        margin-left: 0.5rem;
    }

    .nav-phone {
        padding: 0.625rem 1rem !important;
        min-height: auto !important;
    }

    .phone-number {
        font-size: 1rem;
    }

    .nav-apply-btn {
        margin: 0 0 0 0.5rem !important;
        padding: 0.75rem 1.5rem !important;
        min-height: 48px !important;
    }
}

/* Main content padding (room for fixed header and mobile bottom bar) */
.main {
    padding-top: 70px;
    min-height: 100vh;
    min-height: 100dvh; /* Ported from gold: mobile-first */
    padding-bottom: calc(80px + env(safe-area-inset-bottom)); /* Ported from gold: mobile-first */
}

@media (min-width: 768px) {
    .main {
        padding-bottom: 0;
    }
}

/* Mobile Bottom CTA */
.mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding-bottom: env(safe-area-inset-bottom); /* Ported from gold: mobile-first */
    z-index: 999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    .mobile-bottom-bar {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .page > footer {
        padding-bottom: 85px !important;
    }
}

.mobile-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.25rem;
    text-decoration: none;
    min-height: 50px;
    transition: all 0.2s ease;
    border-right: 1px solid var(--border);
}

    .mobile-btn:last-child {
        border-right: none;
    }

.mobile-call {
    background: var(--primary);
    color: white;
}

.mobile-quote {
    background: white;
    color: var(--primary);
}

.mobile-apply {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.mobile-btn:active {
    opacity: 0.9;
    transform: scale(0.98);
}

/* Flash both ICON and TEXT inside the mobile apply CTA */
@keyframes applyFlash {
    0%, 100% {
        color: white;
    }

    50% {
        color: var(--ari-red);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .mobile-apply .btn-icon,
    .mobile-apply .btn-text {
        animation: applyFlash 1.4s ease-in-out infinite;
    }
}

.btn-icon {
    font-size: 1.25rem;
    margin-bottom: 0.125rem;
}

.btn-text {
    font-size: 0.625rem;
    font-weight: 600;
}

/* Hero Section */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
    padding: 2.5rem 0; /* consistent top/bottom padding for all non-large heroes */
}

@media (min-width: 768px) {
    .hero {
        padding: 4rem 0;
    }
}

/* Ported from gold: mobile-first — Compact hero variant for content pages
   (Contact, Why Join, etc.) — applied only on mobile so the page's actual
   content sits closer to the fold. Home keeps its full-size hero. */
@media (max-width: 767px) {
    .hero.hero-compact {
        padding: 1.25rem 0;
    }

    .hero.hero-compact .hero-slide {
        min-height: auto;
    }

    .hero.hero-compact .hero-content {
        padding: 0;
    }

    .hero.hero-compact .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .hero.hero-compact .hero-subtitle {
        font-size: 0.9375rem;
        margin-bottom: 1rem;
    }

    .hero.hero-compact .hero-buttons {
        margin-top: 0.75rem;
        gap: 0.5rem;
    }
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.625rem 1.5rem;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero-highlight {
    color: #FFD700;
    display: block;
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .hero-highlight {
        font-size: 1.55em;
    }
}

.hero-requirements {
    background: var(--ari-white);
    border: 2px solid var(--ari-red);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: inline-block;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1;
    user-select: text;
    color: var(--text);
}

    .hero-requirements strong {
        color: var(--ari-red);
    }

    .hero-requirements::selection,
    .hero-requirements *::selection {
        background: rgba(204, 0, 0, 0.15);
        color: var(--text);
    }

    .hero-requirements:focus,
    .hero-requirements:active,
    .hero-requirements:focus-within {
        outline: none;
        border: 2px solid var(--ari-red);
    }

.hero-slider {
    position: relative;
    width: 100%;
}

.hero-slide {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 1;
    color: var(--ari-white);
    padding: 2rem 0;
    text-align: center;
}

.hero-title {
    color: white;
    font-size: clamp(1.75rem, 4vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    margin-bottom: 1.5rem;
    opacity: 0.95;
    color: white;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (min-width: 480px) {
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
    }
}

/* Trust Badges */
.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 2rem;
}

.trust-badges .badge {
    background: rgba(255, 255, 255, 0.95);
    color: #000 !important;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

@media (max-width: 480px) {
    .trust-badges {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .trust-badges .badge {
        text-align: center;
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
}

/* Buttons (global) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem; /* Increased for better mobile tap targets */
    min-height: 44px; /* Accessibility: minimum tap target size */
    font-weight: 600;
    text-align: center;
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
    text-decoration: none;
}

@media (min-width: 768px) {
    .btn {
        padding: 0.75rem 2rem;
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--ari-red), #FF0000);
    color: var(--ari-white);
    box-shadow: var(--shadow-md);
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
        color: var(--ari-white);
    }

.btn-secondary {
    background: var(--ari-white);
    color: var(--ari-blue);
    border: 2px solid var(--ari-blue);
}

    .btn-secondary:hover {
        background: var(--ari-blue);
        color: var(--ari-white);
    }

.btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 2px solid #6c757d;
}

    .btn-outline-secondary:hover {
        background: #6c757d;
        color: var(--ari-white);
    }

.btn-link {
    background: none;
    border: none;
    color: var(--ari-light-blue);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

    .btn-link:hover {
        color: var(--ari-red);
        text-decoration: underline;
    }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 15px;
    width: 100%;
}

@media (min-width: 576px) {
    .btn-lg {
        width: auto;
    }
}
