/* ============================================
   FareEagle Design System — main.css
   Apple-inspired, unified across all pages
   ============================================ */

/* === VARIABLES === */
:root {
    --black: #1d1d1f;
    --g1: #86868b;
    --g2: #6e6e73;
    --g3: #d2d2d7;
    --gbg: #f5f5f7;
    --white: #ffffff;
    --coral: #e8734a;
    --magenta: #a8366b;
    --purple: #7b3ba0;
    --blue: #4a7cf7;
    --brand: linear-gradient(135deg, #e8734a, #c94a6b, #7b3ba0, #4a7cf7);
    --brand-light: linear-gradient(135deg, #f7a04b, #f06292, #ba68c8, #7986cb);
    --success: #34c759;
    --danger: #ff3b30;
    --warning: #ff9500;
    --info: #007aff;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);

    /* Legacy compat — maps old variable names to new ones */
    --primary-color: var(--coral);
    --gray: var(--g1);
    --border-color: var(--g3);
    --danger-color: var(--danger);
}

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    color: var(--black); background: var(--white);
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden; line-height: 1.5;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: clamp(24px, 3vw, 32px); }
h3 { font-size: 20px; }
h4 { font-size: 17px; }
p { line-height: 1.6; }

/* === LAYOUT === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* === NAV BAR === */
.header, .nav-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(255,255,255,0.72);
    backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid rgba(0,0,0,0.08);
}
.header-content, .nav-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 24px;
    height: 52px; display: flex; align-items: center; justify-content: space-between;
}
.logo, .nav-logo-link {
    display: flex; align-items: center; gap: 8px; text-decoration: none;
    font-size: 18px; font-weight: 700; color: var(--black);
}
.logo img, .nav-logo-link img, .nav-logo { height: 36px; width: auto; }
.nav, .nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link, .nav-links a {
    font-size: 13px; color: var(--black); text-decoration: none;
    padding: 6px 14px; border-radius: 20px; font-weight: 500;
    transition: background 0.2s;
}
.nav-link:hover, .nav-links a:hover { background: rgba(0,0,0,0.04); }
.nav-cta, .btn-primary-nav {
    background: var(--brand) !important; color: white !important;
    padding: 8px 20px !important; font-weight: 600 !important;
    border-radius: 20px !important; text-decoration: none !important;
    font-size: 13px !important; transition: opacity 0.2s !important;
}
.nav-cta:hover { opacity: 0.9; }
.mob-toggle {
    display: none; background: none; border: none;
    font-size: 22px; cursor: pointer; color: var(--black);
}

/* === CARDS === */
.card {
    background: var(--white);
    border: 1px solid var(--g3);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
}

/* === BUTTONS === */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border: none; border-radius: var(--radius);
    font-size: 15px; font-weight: 600; cursor: pointer;
    font-family: inherit; text-decoration: none;
    transition: all 0.2s; line-height: 1;
}
.btn-primary {
    background: var(--black); color: white;
}
.btn-primary:hover { background: #000; transform: translateY(-1px); }
.btn-gradient {
    background: var(--brand); color: white;
}
.btn-gradient:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(200,74,107,0.25); }
.btn-outline {
    background: transparent; color: var(--black);
    border: 1.5px solid var(--g3);
}
.btn-outline:hover { border-color: var(--black); background: var(--gbg); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* === FORMS === */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; font-size: 12px; font-weight: 600; color: var(--g2);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.form-input, .form-select {
    width: 100%; padding: 13px 16px;
    background: var(--gbg); border: 1.5px solid transparent;
    border-radius: var(--radius); font-size: 15px; font-weight: 500;
    color: var(--black); font-family: inherit; outline: none;
    transition: all 0.2s;
}
.form-input:focus, .form-select:focus {
    background: var(--white); border-color: var(--black);
}
.form-input::placeholder { color: var(--g3); }
.form-select { -webkit-appearance: none; appearance: none; cursor: pointer; }
.form-input.error { border-color: var(--danger); }
small { font-size: 12px; color: var(--g1); margin-top: 4px; display: block; }

/* === ALERTS === */
.alert {
    padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px;
    font-size: 14px; font-weight: 500; line-height: 1.5;
}
.alert-error {
    background: #fff2f0; color: #cc1100; border: 1px solid #ffccc7;
}
.alert-success {
    background: #f0fff4; color: #1a7f37; border: 1px solid #a7f3d0;
}
.alert-warning {
    background: #fffbeb; color: #92400e; border: 1px solid #fde68a;
}
.alert-info {
    background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe;
}

/* === FOOTER === */
.footer, .ftr {
    background: var(--gbg); padding: 40px 24px 24px;
    border-top: 0.5px solid rgba(0,0,0,0.08);
}
.footer-content, .ftr-grid {
    max-width: 1200px; margin: 0 auto;
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
    margin-bottom: 32px;
}
.footer h4, .ftr h4 { font-size: 13px; font-weight: 600; color: var(--black); margin-bottom: 12px; }
.footer p, .ftr p { font-size: 12px; color: var(--g1); line-height: 1.6; }
.footer-links, .ftr-links { list-style: none; }
.footer-links li, .ftr-links li { margin-bottom: 8px; }
.footer-links a, .ftr-links a {
    color: var(--g1); text-decoration: none; font-size: 12px;
    transition: color 0.2s;
}
.footer-links a:hover, .ftr-links a:hover { color: var(--black); }
.footer-bottom, .ftr-bot {
    max-width: 1200px; margin: 0 auto; padding-top: 16px;
    border-top: 0.5px solid rgba(0,0,0,0.08);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: var(--g1);
}
.footer-bottom a, .ftr-bot a {
    color: var(--g1); text-decoration: none; margin-left: 16px;
}
.footer-bottom a:hover, .ftr-bot a:hover { color: var(--black); }

/* === AUTH PAGES (login, register, forgot password) === */
.auth-page {
    min-height: 100vh; display: flex; flex-direction: column;
    padding-top: 52px; /* nav height */
}
.auth-body {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 40px 24px;
}
.auth-card {
    width: 100%; max-width: 480px;
    background: var(--white); border: 1px solid var(--g3);
    border-radius: var(--radius-lg); padding: 40px 36px;
    box-shadow: var(--shadow);
}
.auth-card.wide { max-width: 600px; }
.auth-logo { height: 56px; margin: 0 auto 24px; display: block; }
.auth-title {
    font-size: 28px; font-weight: 800; text-align: center;
    letter-spacing: -0.03em; margin-bottom: 6px;
}
.auth-sub { font-size: 15px; color: var(--g1); text-align: center; margin-bottom: 28px; }
.auth-link { color: var(--coral); text-decoration: none; font-weight: 600; }
.auth-link:hover { text-decoration: underline; }
.auth-divider {
    margin: 24px 0; padding-top: 24px;
    border-top: 1px solid var(--g3); text-align: center;
}
.auth-divider span {
    font-size: 13px; color: var(--g1); background: white;
    padding: 0 12px; position: relative; top: -12px;
}

/* Account type cards (register) */
.account-type-card {
    padding: 16px; border: 2px solid var(--g3); border-radius: var(--radius);
    cursor: pointer; text-align: center; transition: all 0.2s;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.account-type-card:hover { border-color: var(--g1); }
.account-type-card.selected { border-color: var(--coral); background: rgba(232,115,74,0.04); }
.account-type-card input[type="radio"] { display: none; }

/* === SCROLL REVEAL === */
.rv { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.rv.vis { opacity: 1; transform: translateY(0); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .mob-toggle { display: block; }
    .nav, .nav-links { display: none; }
    .nav.open, .nav-links.open {
        display: flex; flex-direction: column;
        position: absolute; top: 52px; left: 0; right: 0;
        background: rgba(255,255,255,0.97);
        backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
        padding: 12px 20px; gap: 4px;
        border-bottom: 0.5px solid rgba(0,0,0,0.08);
    }
    .nav.open a, .nav-links.open a { padding: 12px 16px; border-radius: 10px; font-size: 15px; }
    .auth-card { padding: 28px 24px; }
    .auth-logo { height: 48px; }
    .footer-content, .ftr-grid { grid-template-columns: 1fr 1fr; }
    .footer-bottom, .ftr-bot { flex-direction: column; gap: 8px; text-align: center; }
    .card { padding: 24px 20px; }
}

@media (max-width: 480px) {
    .footer-content, .ftr-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 24px 20px; border-radius: var(--radius); }
}
