/* ============================================================
   COLLISION APP — Frontend Dark Theme
   ============================================================ */

:root {
  --bg-primary:    #0a0a0f;
  --bg-secondary:  #12121a;
  --bg-card:       #1a1a2e;
  --bg-card2:      #16213e;
  --accent:        #f59e0b;
  --accent-hover:  #d97706;
  --text-primary:  #e8e8f0;
  --text-muted:    #a0aab8;
  --border:        #2a2a4e;
  --success:       #10b981;
  --danger:        #ef4444;
  --info:          #3b82f6;
  --sidebar-w:     260px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ---------- Wrapper / Layout ---------- */
.wrapper {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand i { font-size: 1.4rem; }
.sidebar-brand:hover { color: var(--accent-hover); background: rgba(245,158,11,0.05); }

.nav-menu {
  padding: 16px 12px;
  flex: 1;
}

.nav-item-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 4px;
  transition: all 0.15s;
}
.nav-item-custom:hover { color: var(--text-primary); background: rgba(245,158,11,0.08); }
.nav-item-custom.active {
  color: var(--accent);
  background: rgba(245,158,11,0.12);
  border-left: 3px solid var(--accent);
}
.nav-item-custom i { width: 18px; text-align: center; }

.btn-new-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-new-entry:hover { background: var(--accent-hover); color: var(--bg-primary); }

/* ---------- Topbar ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: 64px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 99;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info { text-align: right; line-height: 1.3; }
.user-name { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.user-role { display: block; font-size: 0.7rem; color: var(--text-muted); }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--bg-primary);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Main Content ---------- */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: 64px;
  padding: 28px 32px;
  min-height: calc(100vh - 64px);
  flex: 1;
}

/* ---------- Guest: No Sidebar ---------- */
body.is-guest .main-content {
  margin-left: 0;
  margin-top: 0;
  padding: 0;
}

/* ---------- Navbar (guest / landing) ---------- */
.landing-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  transition: background 0.3s;
}
.landing-nav.scrolled {
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.landing-nav .brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.1rem; font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}
.landing-nav .brand i { color: var(--accent); }
.landing-nav .nav-links { display: flex; gap: 24px; align-items: center; }
.landing-nav .nav-links a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; transition: color 0.15s; }
.landing-nav .nav-links a:hover { color: var(--text-primary); }

/* ---------- Landing Hero ---------- */
.landing-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 80px 40px 60px;
  background:
    radial-gradient(ellipse at 70% 50%, rgba(245,158,11,0.12) 0%, transparent 55%),
    var(--bg-primary);
  position: relative;
  overflow: hidden;
}
.landing-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23f59e0b' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { max-width: 600px; position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  color: var(--accent);
  padding: 6px 14px; border-radius: 100px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.5px;
  margin-bottom: 24px;
}
.hero-title {
  font-size: 3.5rem; font-weight: 800; line-height: 1.1;
  color: var(--text-primary);
  margin: 0 0 20px;
}
.hero-title span { color: var(--accent); }
.hero-subtitle {
  font-size: 1.1rem; color: var(--text-muted); line-height: 1.7;
  margin: 0 0 36px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn-accent {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--bg-primary);
  padding: 14px 28px; border-radius: 8px; border: none;
  font-weight: 700; font-size: 0.95rem; cursor: pointer;
  text-decoration: none; transition: background 0.15s, transform 0.1s;
}
.btn-accent:hover { background: var(--accent-hover); color: var(--bg-primary); transform: translateY(-1px); }

.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--text-primary);
  padding: 14px 28px; border-radius: 8px;
  border: 1px solid var(--border); font-weight: 600; font-size: 0.95rem;
  text-decoration: none; transition: border-color 0.15s, background 0.15s;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: rgba(245,158,11,0.05); }

/* ---------- Sections ---------- */
.landing-section {
  padding: 80px 40px;
}
.landing-section .section-label {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.landing-section h2 {
  font-size: 2.2rem; font-weight: 800; color: var(--text-primary); margin: 0 0 16px;
}
.landing-section .section-sub {
  color: var(--text-muted); max-width: 500px; line-height: 1.7; margin-bottom: 48px;
}

/* How it works steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 768px) { .steps { grid-template-columns: 1fr; } }
.step-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px; position: relative;
  transition: border-color 0.2s;
}
.step-card:hover { border-color: rgba(245,158,11,0.4); }
.step-number {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3);
  color: var(--accent); font-weight: 800; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.step-icon { font-size: 1.8rem; color: var(--accent); margin-bottom: 12px; }
.step-card h3 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin: 0 0 8px; }
.step-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; margin: 0; }

/* Feature cards */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 1024px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px)  { .feature-grid { grid-template-columns: 1fr; } }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px;
  transition: border-color 0.2s, transform 0.15s;
}
.feature-card:hover { border-color: rgba(245,158,11,0.3); transform: translateY(-3px); }
.feature-card .icon {
  width: 48px; height: 48px; border-radius: 10px;
  background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: var(--accent); margin-bottom: 16px;
}
.feature-card h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); margin: 0 0 8px; }
.feature-card p  { font-size: 0.83rem; color: var(--text-muted); line-height: 1.6; margin: 0; }

/* CTA Section */
.landing-cta {
  background: var(--bg-card); border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border); text-align: center; padding: 80px 40px;
}
.landing-cta h2 { font-size: 2.5rem; font-weight: 800; color: var(--text-primary); margin: 0 0 12px; }
.landing-cta p { color: var(--text-muted); margin: 0 0 36px; font-size: 1.05rem; }
.landing-cta .actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* Footer */
.landing-footer {
  background: var(--bg-secondary); border-top: 1px solid var(--border);
  padding: 40px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.landing-footer .brand { font-weight: 800; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.landing-footer .brand i { color: var(--accent); }
.landing-footer p { color: var(--text-muted); font-size: 0.83rem; margin: 0; }

/* ---------- Lang Switcher ---------- */
.lang-switcher { display: flex; gap: 4px; }
.lang-btn {
  padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600;
  color: var(--text-muted); background: transparent;
  border: 1px solid var(--border); text-decoration: none; transition: all 0.15s;
}
.lang-btn:hover, .lang-btn.active { background: var(--accent); color: var(--bg-primary); border-color: var(--accent); }

/* ---------- Cards (general) ---------- */
.card { border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); }
.card-header { background: var(--bg-card2); border-bottom: 1px solid var(--border); padding: 16px 20px; border-radius: 12px 12px 0 0; }
.card-body { padding: 20px; }

/* ---------- Forms ---------- */
.form-control, .form-select {
  background: #000000 !important; border: 1px solid var(--border); color: var(--text-primary);
  border-radius: 8px; font-size: 0.9rem;
}
.form-control:focus, .form-select:focus {
  background: #000000 !important; color: var(--text-primary);
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}
.form-control::placeholder {
  color: #b0b0b0 !important;
  opacity: 1;
}
label.control-label, .form-label, label { font-size: 0.83rem; color: var(--text-primary) !important; font-weight: 500; margin-bottom: 6px; display: inline-block; }

/* Override browser autofill background */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active  {
    -webkit-box-shadow: 0 0 0 30px #000000 inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ---------- Alerts ---------- */
.alert-success { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: #6ee7b7; }
.alert-danger   { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.3);  color: #fca5a5; }
.alert-warning  { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: #fcd34d; }

/* ---------- Status Badges ---------- */
.badge-warning  { background: rgba(245,158,11,0.2); color: #fcd34d; }
.badge-info     { background: rgba(59,130,246,0.2); color: #93c5fd; }
.badge-primary  { background: rgba(99,102,241,0.2); color: #a5b4fc; }
.badge-secondary{ background: rgba(107,114,128,0.2);color: #9ca3af; }
.badge-success  { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.badge-dark     { background: rgba(31,41,55,0.6);   color: #9ca3af; }

/* ---------- Portal pages (authenticated frontend) ---------- */
.portal-page { max-width: 960px; margin: 0 auto; }
.portal-page h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 24px; }

.claim-status-badge {
  display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600;
}

/* ---------- Hamburger Button ---------- */
.hamburger-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem; flex-shrink: 0;
}
.hamburger-btn:hover { background: rgba(245,158,11,0.1); color: var(--accent); }

/* ---------- Sidebar Overlay ---------- */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ---------- Responsive ---------- */

/* ≥1200px: full sidebar always visible */
@media (min-width: 1200px) {
  .sidebar { transform: translateX(0) !important; }
  .sidebar-overlay { display: none !important; }
  .main-content { margin-left: var(--sidebar-w); }
  .topbar { margin-left: var(--sidebar-w); }
}

/* <1200px: sidebar off-screen by default, toggle with .open */
@media (max-width: 1199.98px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
    transition: transform 0.3s ease;
    z-index: 100;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .topbar       { left: 0 !important; }
}

/* <768px: mobile */
@media (max-width: 767.98px) {
  .hero-title      { font-size: 2.2rem; }
  .landing-nav     { padding: 16px 20px; }
  .landing-section { padding: 60px 20px; }
  .landing-footer  { padding: 24px 20px; }
  .how-steps       { grid-template-columns: 1fr; }
  .benefits-grid   { grid-template-columns: 1fr; }
  .main-content    { padding: 1rem; }
  .topbar          { padding: 0 1rem; height: 58px; }
  .user-info       { display: none; }
  .portal-page h1  { font-size: 1.4rem; }
  /* Stacked form columns */
  .row.g-3 > [class*="col-md"] { width: 100%; }
}

/* <576px: small phones */
@media (max-width: 575.98px) {
  .hero-title      { font-size: 1.8rem; }
  .hero-subtitle   { font-size: 1rem; }
  .step-card, .benefit-card { padding: 20px 16px; }
  .btn-accent, .btn-outline { width: 100%; text-align: center; justify-content: center; }
  .landing-cta-btns { flex-direction: column; gap: 12px; }
  .topbar { height: 54px; }
}
