/* ==========================================================================
   Design System — CSS Custom Properties
   Adapt colours and fonts to the spec's brand. Every component rule below
   references these variables — no hardcoded hex values outside :root.
   ========================================================================== */
:root {
    /* Brand — sampled from the Uiga globe/ring logo (deep blue), with a
       warm amber accent for CTAs so "Get a Quote" buttons stand out
       against the blue header/hero. */
    --primary:        #17548f;
    --primary-dark:   #103d69;
    --sky:            #4fa8dc;
    --accent:         #f2a71b;
    --accent-dark:    #d68f0d;

    /* Neutrals */
    --bg-base:        #f1f5f9;
    --bg-surface:     #ffffff;
    --border-light:   #d1d5db;
    --text-base:      #1e293b;
    --text-muted:     #64748b;

    /* Status */
    --success:        #16a34a;
    --success-bg:     #dcfce7;
    --error:          #dc2626;
    --error-bg:       #fee2e2;

    /* Typography */
    --font-heading:   'Outfit', sans-serif;
    --font-body:      'Inter', sans-serif;

    /* Spacing scale */
    --radius:         8px;
    --radius-lg:      12px;
    --shadow:         0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text-base);
    background: var(--bg-base);
    line-height: 1.6;
}
h1, h2, h3, h4 { font-family: var(--font-heading); margin: 0 0 0.5em; }
a { color: var(--primary); }
img { max-width: 100%; display: block; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg-surface); color: var(--text-base); border-color: var(--border-light); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--error); color: #fff; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--bg-surface);
}
.form-control:focus { outline: none; border-color: var(--primary); }

.password-field-wrapper { position: relative; }
.password-field-wrapper .form-control { padding-right: 42px; }
.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: none;
    border: none;
    line-height: 0;
    color: var(--text-muted);
    cursor: pointer;
}
.password-toggle-btn:hover { color: var(--text-base); }
.password-toggle-btn svg { width: 18px; height: 18px; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
}
.card-title { font-size: 1.15rem; margin-bottom: 8px; }
.card-content { color: var(--text-muted); }

/* ── Headings / labels ────────────────────────────────────────────────── */
.page-title { font-size: 2rem; margin-bottom: 24px; }
.section-title { font-size: 1.6rem; margin-bottom: 12px; }
.section-label { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; color: var(--accent); font-weight: 700; }

/* ── Alerts ───────────────────────────────────────────────────────────── */
.success-msg, .error-msg {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: 0.95rem;
}
.success-msg { background: var(--success-bg); color: var(--success); }
.error-msg { background: var(--error-bg); color: var(--error); }

/* ── Header / nav ─────────────────────────────────────────────────────── */
.main-header { background: var(--bg-surface); border-bottom: 1px solid var(--border-light); position: sticky; top: 0; z-index: 200; }
.header-container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-img { height: 36px; }
.logo-text { font-family: var(--font-heading); font-weight: 700; font-size: 1.2rem; color: var(--text-base); }
.main-nav { display: flex; align-items: center; gap: 24px; }
.nav-links { display: flex; list-style: none; gap: 20px; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--text-base); font-weight: 500; }
.auth-links { display: flex; gap: 10px; align-items: center; }

.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text-base); transition: transform .25s, opacity .25s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 899px) {
    /* Uiga's header carries more content than the shared template assumes —
       5 nav links plus a persistent "Get a Quote" CTA and login/register —
       which overflows at the generic 767px breakpoint. Widened specifically
       for this site's nav rather than trimming content. */
    .hamburger { display: flex; }
    .main-nav { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-surface); border-bottom: 1px solid var(--border-light); padding: 16px; z-index: 100; }
    .main-nav.open { display: flex; }
    .nav-links { flex-direction: column; gap: 0; }
    .auth-links { flex-direction: column; gap: 8px; margin-top: 16px; }
}

/* ── Content / footer ─────────────────────────────────────────────────── */
.main-content { min-height: 60vh; padding: 32px 0; }
.main-footer { background: var(--text-base); color: #fff; padding: 32px 0; margin-top: 40px; }
.footer-container { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: #fff; opacity: 0.85; text-decoration: none; }
.footer-copy { opacity: 0.7; font-size: 0.85rem; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-base); }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-light); }
th { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }

/* ── Auth pages ───────────────────────────────────────────────────────── */
.auth-container {
    max-width: 420px;
    margin: 60px auto;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 36px;
}

.text-muted { color: var(--text-muted); }

/* ── Accent button (CTA) ──────────────────────────────────────────────── */
.btn-accent { background: var(--accent); color: #1e293b; }
.btn-accent:hover { background: var(--accent-dark); }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 64px 40px;
    text-align: center;
    margin-bottom: 40px;
}
.hero-section .section-label { color: var(--accent); }
.hero-section .page-title { color: #fff; margin-bottom: 16px; }
.hero-section p { max-width: 640px; margin: 0 auto 28px; color: rgba(255,255,255,0.9); font-size: 1.1rem; }

.callout-band {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-top: 24px;
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}
@media (min-width: 768px) { .callout-band { grid-template-columns: 1fr 1fr; } }
.callout-band h3 { margin-bottom: 8px; }

/* ── Pricing / product cards ──────────────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin: 24px 0 40px; }
@media (min-width: 768px) { .pricing-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
.pricing-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    display: flex;
    flex-direction: column;
}
.pricing-card h3 { font-size: 1.25rem; }
.pricing-card .tagline { color: var(--text-muted); margin-bottom: 16px; }
.pricing-card .price { font-family: var(--font-heading); font-size: 1.9rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.pricing-card .price-unit { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 18px; }
.pricing-card .price-cta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 18px; }
.pricing-card .features-list { list-style: none; padding: 0; margin: 0 0 24px; flex-grow: 1; }
.pricing-card .features-list li { padding: 6px 0; border-bottom: 1px solid var(--border-light); font-size: 0.92rem; }
.pricing-card .features-list li:last-child { border-bottom: none; }
.pricing-card .btn { align-self: flex-start; }

/* ── Status badges (RFQ / quote / payment lifecycle) ─────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; text-transform: capitalize; }
.badge-submitted, .badge-under_review, .badge-pending { background: #fef3c7; color: #92400e; }
.badge-quoted { background: #dbeafe; color: #1e40af; }
.badge-accepted, .badge-paid, .badge-completed { background: var(--success-bg); color: var(--success); }
.badge-in_progress { background: #e0e7ff; color: #3730a3; }
.badge-rejected, .badge-expired, .badge-failed { background: var(--error-bg); color: var(--error); }

/* ── Portal / admin detail panels ────────────────────────────────────── */
.detail-panel { background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px; }
.detail-panel h3 { margin-top: 0; }
.quote-box { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.quote-box .amount { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700; color: var(--primary); }

/* ── Admin nav ────────────────────────────────────────────────────────── */
.admin-nav-section { text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.06em; color: var(--text-muted); margin: 20px 0 8px; font-weight: 700; }
.admin-nav-link { display: inline-block; margin: 4px 12px 4px 0; padding: 8px 14px; background: var(--bg-surface); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--text-base); font-weight: 500; font-size: 0.9rem; }
.admin-nav-link:hover { background: var(--primary); color: #fff; }
