/* Rally Vehicle Monitor — civic, professional, mobile-first */

:root {
    --rvm-navy: #0f2744;
    --rvm-navy-mid: #1a3a5c;
    --rvm-accent: #2dd4bf;
    --rvm-accent-dark: #14b8a6;
    --rvm-gold: #e8c547;
    --rvm-surface: #f4f7fb;
    --rvm-card: #ffffff;
    --rvm-text: #1e293b;
    --rvm-muted: #64748b;
    --rvm-radius: 0.75rem;
    --rvm-radius-lg: 1rem;
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Inter", var(--font-sans);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--rvm-text);
    background: var(--rvm-surface);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6,
.display-font {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

/* Navbar */
.navbar-rvm {
    background: linear-gradient(135deg, var(--rvm-navy) 0%, var(--rvm-navy-mid) 100%);
}

.navbar-rvm .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    border-radius: 0.5rem;
}

.navbar-rvm .nav-link:hover,
.navbar-rvm .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
}

.brand-icon {
    width: 2.25rem;
    height: 2.25rem;
    background: linear-gradient(145deg, var(--rvm-accent) 0%, var(--rvm-accent-dark) 100%);
    color: var(--rvm-navy);
    font-size: 1.1rem;
}

.brand-icon--sm {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.9rem;
}

/* Hero */
.hero-rvm {
    background: linear-gradient(160deg, var(--rvm-navy) 0%, #0c1f35 45%, var(--rvm-navy-mid) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero-rvm::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(45, 212, 191, 0.18), transparent),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(232, 197, 71, 0.08), transparent);
    pointer-events: none;
}

.hero-rvm .container {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--rvm-accent);
}

.btn-hero-primary {
    --bs-btn-bg: var(--rvm-accent);
    --bs-btn-border-color: var(--rvm-accent);
    --bs-btn-hover-bg: #5eead4;
    --bs-btn-hover-border-color: #5eead4;
    --bs-btn-active-bg: var(--rvm-accent-dark);
    --bs-btn-active-border-color: var(--rvm-accent-dark);
    --bs-btn-color: var(--rvm-navy);
    --bs-btn-hover-color: var(--rvm-navy);
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    border-radius: 0.65rem;
}

.btn-hero-outline {
    --bs-btn-color: #fff;
    --bs-btn-border-color: rgba(255, 255, 255, 0.45);
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.12);
    --bs-btn-hover-border-color: #fff;
    --bs-btn-hover-color: #fff;
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    border-radius: 0.65rem;
}

/* Feature cards */
.feature-card {
    background: var(--rvm-card);
    border-radius: var(--rvm-radius-lg);
    border: 1px solid rgba(15, 39, 68, 0.08);
    box-shadow: 0 4px 24px rgba(15, 39, 68, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(15, 39, 68, 0.1);
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--rvm-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    background: linear-gradient(145deg, rgba(45, 212, 191, 0.2) 0%, rgba(20, 184, 166, 0.12) 100%);
    color: var(--rvm-navy-mid);
}

/* CTA strip */
.cta-strip {
    background: linear-gradient(90deg, var(--rvm-navy-mid), #163252);
    color: #fff;
    border-radius: var(--rvm-radius-lg);
}

/* Forms */
.form-card {
    background: var(--rvm-card);
    border-radius: var(--rvm-radius-lg);
    border: 1px solid rgba(15, 39, 68, 0.08);
    box-shadow: 0 8px 32px rgba(15, 39, 68, 0.08);
}

.form-section-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--rvm-navy);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(45, 212, 191, 0.35);
}

.form-label {
    font-weight: 500;
    color: var(--rvm-text);
    font-size: 0.9rem;
}

.form-control,
.form-select {
    border-radius: 0.5rem;
    border-color: #cbd5e1;
    padding: 0.6rem 0.85rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--rvm-accent-dark);
    box-shadow: 0 0 0 0.2rem rgba(45, 212, 191, 0.25);
}

.file-drop-zone {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: var(--rvm-radius);
    padding: 1.25rem;
    text-align: center;
    background: var(--rvm-surface);
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

/* Cover the drop zone so the file input receives taps (display:none breaks many mobile browsers). */
.file-drop-zone .file-input-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 1rem; /* avoid iOS zoom quirks on focus */
    z-index: 2;
}

.file-drop-zone:hover,
.file-drop-zone:focus-within {
    border-color: var(--rvm-accent-dark);
    background: rgba(45, 212, 191, 0.06);
}

.file-preview {
    max-height: 140px;
    border-radius: 0.5rem;
    object-fit: cover;
    width: 100%;
    display: none;
}

.file-preview.is-visible {
    display: block;
}

.file-drop-zone .file-preview.is-visible {
    position: relative;
    z-index: 1;
}

.btn-submit-rvm {
    background: linear-gradient(135deg, var(--rvm-navy-mid) 0%, var(--rvm-navy) 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 0.65rem;
}

.btn-submit-rvm:hover {
    color: #fff;
    filter: brightness(1.08);
}

/* Admin login */
.admin-login-wrap {
    min-height: calc(100vh - 56px);
    background: linear-gradient(165deg, var(--rvm-navy) 0%, #0a1628 100%);
}

.admin-card {
    border-radius: var(--rvm-radius-lg);
    border: none;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.permission-pill {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 100px;
    background: rgba(45, 212, 191, 0.15);
    color: var(--rvm-accent-dark);
    font-weight: 600;
}

/* Footer */
.footer-rvm {
    background: var(--rvm-navy);
    color: rgba(255, 255, 255, 0.7);
}

/* Utilities */
.text-rvm-muted {
    color: var(--rvm-muted) !important;
}

.text-rvm-accent {
    color: var(--rvm-accent) !important;
}

.text-rvm-navy {
    color: var(--rvm-navy) !important;
}

@media (max-width: 575.98px) {
    .hero-rvm {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
}

/* Tom Select — align with Bootstrap form controls */
.ts-wrapper.form-select,
.ts-wrapper.single .ts-control {
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0;
    border-radius: 0.5rem;
}

.ts-wrapper.single .ts-control {
    padding: 0.6rem 2.25rem 0.6rem 0.85rem;
    box-shadow: none;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--rvm-accent-dark);
    box-shadow: 0 0 0 0.2rem rgba(45, 212, 191, 0.25);
}

.ts-dropdown .option {
    padding: 0.5rem 0.85rem;
}

.ts-dropdown .active {
    background: rgba(45, 212, 191, 0.2);
    color: var(--rvm-navy);
}

/* Admin shell */
body.admin-body {
    display: block;
    min-height: 100vh;
    background: var(--rvm-surface);
}

.admin-sidebar {
    width: 100%;
    max-width: 16.5rem;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--rvm-navy) 0%, #0c1f35 100%);
}

.admin-side-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.admin-side-nav .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.admin-side-nav .nav-link.active {
    color: var(--rvm-navy);
    background: var(--rvm-accent);
}

.admin-main {
    background: var(--rvm-surface);
    min-width: 0;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-registration-photo {
    max-height: 420px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.04);
}

@media (max-width: 991.98px) {
    .admin-shell {
        flex-direction: column;
    }

    .admin-sidebar {
        max-width: none;
    }
}
