/* Base CSS - theme variables below control the whole site look.
   Page sections (hero, cards, steps, the form) are in public.css. */

:root {
    /* Brand gradient: deep teal -> cyan -> blue. White text on every stop stays
       above 5.3:1, so a gradient button or band never needs a second text colour. */
    --color-gradient-start: #0F766E;
    --color-gradient-mid: #0E7490;
    --color-gradient-end: #1D4ED8;

    --color-primary: #0E7490;
    --color-primary-dark: #155E75;
    --color-secondary: #1D4ED8;
    /* The "boost": an amber spark, used small and only on dark backgrounds. */
    --color-accent: #FBBF24;
    --color-success: #15803D;
    --color-danger: #B91C1C;
    --color-warning: #B45309;

    /* Ink and neutrals (contrast on white: text 14.6:1, muted 7.6:1). */
    --color-ink: #0B1324;
    --color-ink-soft: #13203A;
    --color-text: #1E293B;
    --color-muted: #475569;
    --color-eyebrow: #0F766E;
    --color-line: #E2E8F0;
    --color-field-border: #7A8699;
    --color-surface: #FFFFFF;
    --color-surface-alt: #F3F7FA;
    /* On the ink background: body 15:1, quieter text 8.8:1. */
    --color-on-dark: #E2E8F0;
    --color-on-dark-muted: #A5B4C8;
    --color-focus: #0E7490;
    --color-focus-on-dark: #67E8F9;

    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-family-headings: 'Outfit', 'Inter', sans-serif;
    --font-size-base: 16px;

    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(11, 19, 36, 0.06), 0 2px 8px rgba(11, 19, 36, 0.05);
    --shadow-md: 0 12px 32px rgba(11, 19, 36, 0.10);
    --shadow-brand: 0 8px 24px rgba(14, 116, 144, 0.28);

    /* Gradient definitions */
    --gradient-primary: linear-gradient(135deg, var(--color-gradient-start) 0%, var(--color-gradient-mid) 50%, var(--color-gradient-end) 100%);
    --gradient-primary-hover: linear-gradient(135deg, #115E59 0%, #155E75 50%, #1E40AF 100%);
    /* For text on the ink background, where the brand stops would be too dark. */
    --gradient-on-dark: linear-gradient(120deg, #5EEAD4 0%, #67E8F9 45%, #93C5FD 100%);

    /* Bootstrap's own variables, so its components follow the theme. */
    --bs-body-font-family: var(--font-family-base);
    --bs-body-color: var(--color-text);
    --bs-link-color: var(--color-primary);
    --bs-link-color-rgb: 14, 116, 144;
    --bs-link-hover-color: var(--color-primary-dark);
    --bs-link-hover-color-rgb: 21, 94, 117;
    --bs-border-color: var(--color-line);
    --bs-focus-ring-color: rgba(14, 116, 144, 0.35);
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text);
    font-weight: 400;
    background: var(--color-surface);
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-headings);
    font-weight: 700;
    color: var(--color-ink);
    letter-spacing: -0.02em;
    text-wrap: balance;
}

/* No single word stranded on a paragraph's last line, where browsers can. */
p, li, figcaption {
    text-wrap: pretty;
}

.lead {
    font-family: var(--font-family-base);
    font-size: 1.2rem;
    line-height: 1.7;
    font-weight: 400;
}

/* Container: 16px side gutters on a phone, 1200px at most. */
.container {
    max-width: 1200px;
    --bs-gutter-x: 2rem;
}

/* Custom utilities */
.text-primary {
    color: var(--color-primary) !important;
}

/* Keyboard focus is always visible. */
:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

/* "Skip to main content": hidden until a keyboard user reaches it. */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 2000;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--color-ink);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

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

main:focus {
    outline: none;
}

/* Card enhancements */
.card {
    border: none;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* Button enhancements */
.btn {
    font-family: var(--font-family-headings);
    font-weight: 600;
    padding: 0.7rem 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
    border-radius: 10px;
    letter-spacing: 0.01em;
}

.btn-sm {
    padding: 0.45rem 1rem;
    font-size: 0.92rem;
}

.btn-lg {
    padding: 0.85rem 1.8rem;
    font-size: 1.08rem;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: #fff;
    box-shadow: var(--shadow-brand);
}

.btn-primary:hover,
.btn-primary:focus-visible,
.btn-primary:active {
    background: var(--gradient-primary-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(14, 116, 144, 0.36);
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.85);
    color: #fff;
    font-weight: 600;
}

.btn-outline-light:hover,
.btn-outline-light:focus-visible {
    background: #fff;
    color: var(--color-ink);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.18);
}

.btn-light {
    background: #fff;
    color: var(--color-ink);
    border: none;
}

.btn-light:hover,
.btn-light:focus-visible {
    background: #fff;
    color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(11, 19, 36, 0.25);
}

/* Form enhancements */
.form-control,
.form-select {
    border-color: var(--color-field-border);
    border-radius: 10px;
    min-height: 48px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.25rem rgba(14, 116, 144, 0.2);
}

/* Navbar: light, so Bootstrap's toggler icon is dark on it. */
.navbar {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--color-line);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    backdrop-filter: saturate(180%) blur(10px);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
}

.navbar .navbar-nav .nav-link {
    color: var(--color-text);
    font-weight: 500;
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link[aria-current="page"] {
    color: var(--color-primary);
}

/* Footer styling */
footer {
    margin-top: auto;
}

/* Feature icons */
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: var(--gradient-primary);
    border-radius: 50%;
    color: white;
}

/* Gradient text */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-light {
    background: var(--gradient-on-dark);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Badge gradient */
.badge-gradient {
    background: var(--gradient-primary);
    color: white;
}

/* Logo container */
.logo-container img {
    max-height: 150px;
    width: auto;
}

/* Alert improvements */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* List group improvements */
.list-group-item {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem !important;
    margin-bottom: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0 !important;
    }

    .display-4,
    .display-5 {
        font-size: 2rem;
    }

    .lead {
        font-size: 1.1rem;
    }

    /* Navbar mobile adjustments */
    .navbar-brand img {
        height: 50px !important;
        width: auto;
    }

    /* Body text mobile adjustments */
    body {
        font-size: 17px;
    }

    /* Button mobile adjustments */
    .btn-lg {
        padding: 0.8rem 1.6rem;
        font-size: 1.05rem;
    }

    /* Form input mobile adjustments */
    .form-control {
        font-size: 16px;
    }

    textarea.form-control {
        min-height: 140px;
    }
}

/* Smooth scrolling, unless the visitor asked for less motion */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Loading states */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}
