@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap");

:root {
  --ink: #17110a;
  --muted: #786d58;
  --line: #e4d6ae;
  --surface: #fffaf0;
  --soft: #f6edd7;
  --green: #d5a73a;
  --green-dark: #8b6416;
  --red: #14110c;
  --blue: #7e6126;
  --violet: #5d4720;
  --amber: #f0c75c;
  --black: #080705;
  --gold: #d5a73a;
  --gold-light: #f4dd8b;
  --shadow: 0 18px 50px rgba(18, 12, 4, .18);
  font-family: "Cairo", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #f4ead2;
  font-size: 16px;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 48px);
  color: white;
  background: rgba(8, 7, 5, .96);
  border-bottom: 1px solid rgba(213,167,58,.32);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #12201d;
  background: #090805;
  border: 1px solid rgba(244,221,139,.55);
  overflow: hidden;
  flex: 0 0 auto;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: rgba(255,255,255,.76);
  font-size: 13px;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.session-pill, .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: #4a350c;
  background: #f5e5b0;
  font-size: 13px;
  white-space: nowrap;
}

.tag.violet { color: #523b7d; background: #eee8fb; }
.tag.warn { color: #774f0a; background: #fff0cf; }
.tag.hot { color: #7a271a; background: #ffe7dd; }

.btn {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.big { min-height: 50px; padding: 0 18px; font-weight: 700; }
.btn.primary { color: #17110a; background: linear-gradient(180deg, #f3d777, #d0a033); box-shadow: 0 10px 24px rgba(213,167,58,.24); font-weight: 800; }
.btn.secondary { color: var(--ink); background: white; border: 1px solid var(--line); }
.btn.light { color: white; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); }
.btn.danger { color: var(--gold-light); background: #11100c; border: 1px solid rgba(244,221,139,.36); box-shadow: 0 10px 24px rgba(0,0,0,.24); }

body:not(.logged-in) .logged-only { display: none !important; }
body.logged-in .hero, body.logged-in .public-section { display: none; }

.hero {
  min-height: calc(100vh - 74px);
  color: white;
  background:
    linear-gradient(90deg, rgba(8, 7, 5, .92), rgba(8, 7, 5, .68), rgba(8, 7, 5, .34)),
    url("./road-assist-bg.png") center/cover;
}

.hero-inner {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(380px, 1.05fr) minmax(320px, .68fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(34px, 5vw, 72px) clamp(18px, 5vw, 72px);
}

.hero-copy { max-width: 760px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--gold-light);
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.22);
  font-size: 13px;
}

.eyebrow.dark {
  color: #4a350c;
  background: #f5e5b0;
  border-color: transparent;
}

.hero h1 {
  margin: 18px 0 14px;
  max-width: 820px;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.12;
  letter-spacing: 0;
}

.hero p {
  max-width: 710px;
  margin: 0 0 12px;
  color: rgba(255,255,255,.84);
  font-size: 17px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-card {
  align-self: end;
  border-radius: 8px;
  padding: 22px;
  background: rgba(255,250,240,.96);
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: var(--shadow);
}

.hero-card h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.hero-logo {
  display: block;
  width: min(330px, 86%);
  margin: 0 auto 16px;
  border-radius: 8px;
  border: 1px solid rgba(213,167,58,.32);
  background: var(--black);
}

.flow-list {
  display: grid;
  gap: 12px;
}

.flow-list div {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
}

.flow-list span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  color: #17110a;
  background: linear-gradient(180deg, #f2da80, #c9952c);
  font-weight: 700;
}

.flow-list p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.public-section {
  padding: 44px clamp(16px, 5vw, 72px) 56px;
  background: #f4ead2;
}

.section-head {
  max-width: 760px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 12px 0 0;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.2;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.feature-card, .panel, .card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feature-card {
  min-height: 190px;
  padding: 18px;
}

.feature-card i {
  color: var(--gold);
}

.feature-card h3 {
  margin: 14px 0 8px;
  font-size: 20px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(290px, .78fr) minmax(430px, 1.18fr) minmax(310px, .86fr);
  gap: 16px;
  padding: 18px clamp(12px, 2.5vw, 28px) 28px;
}

.side-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.panel {
  overflow: hidden;
}

.panel-header, .ops-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.72);
}

.panel-header h2, .ops-header h2 {
  margin: 0;
  font-size: 20px;
}

.operations {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251,255,253,.95);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #31413f;
  font-size: 14px;
  font-weight: 700;
}

.field input, .field select, .field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  background: white;
  outline: none;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(213,167,58,.18);
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px 16px 0;
}

.stat {
  min-height: 82px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.stat strong {
  display: block;
  font-size: 25px;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.request-form {
  border-bottom: 1px solid var(--line);
}

.cards, .list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.list {
  padding-top: 0;
}

.card {
  display: grid;
  gap: 10px;
  padding: 13px;
  box-shadow: none;
}

.card.locked {
  border-color: rgba(213,167,58,.48);
  background: #fff8e7;
}

.row-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
}

.card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fcfa;
  color: var(--ink);
  font-size: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions .btn {
  min-height: 36px;
  padding: 0 10px;
  box-shadow: none;
}

.admin-users {
  display: none;
}

body.admin .admin-users {
  display: block;
}

.admin-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 16px 0;
}

.admin-tab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  color: var(--muted);
  font-weight: 800;
}

.admin-tab.active {
  color: #17110a;
  background: linear-gradient(180deg, #f4dc82, #d0a033);
  border-color: rgba(213,167,58,.5);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 23, 20, .62);
}

.modal-card {
  position: relative;
  width: min(920px, 100%);
  max-height: min(92vh, 840px);
  overflow: auto;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0,0,0,.28);
}

.modal-close {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  display: grid;
  place-items: center;
}

.auth-layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  min-height: 620px;
}

.auth-side {
  padding: 28px 24px;
  color: white;
  background:
    linear-gradient(180deg, rgba(8,7,5,.86), rgba(8,7,5,.96)),
    url("./road-assist-bg.png") center/cover;
  border-left: 1px solid rgba(213,167,58,.28);
}

.auth-side img {
  display: block;
  width: 156px;
  height: 156px;
  object-fit: contain;
  margin: 8px auto 22px;
  border-radius: 50%;
  border: 1px solid rgba(244,221,139,.45);
  background: #070605;
}

.auth-side h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
}

.auth-side p {
  margin: 10px 0 20px;
  color: rgba(255,255,255,.78);
  line-height: 1.75;
}

.auth-side-points {
  display: grid;
  gap: 10px;
}

.auth-side-points span {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(244,221,139,.22);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  font-size: 14px;
}

.auth-main {
  padding: 24px 24px 20px;
}

.modal-head {
  padding: 0 0 14px;
}

.modal-head h2 {
  margin: 10px 0 6px;
  font-size: 28px;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7edcf;
  margin-bottom: 12px;
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-tab.active {
  color: #17110a;
  background: white;
  box-shadow: 0 8px 22px rgba(18,12,4,.1);
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 0 14px;
}

.social-btn {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.social-btn.soon {
  opacity: .7;
  cursor: not-allowed;
  background: #f7f0df;
}

.social-btn.soon span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: #6f4d0f;
  background: #f5e1a0;
  font-size: 12px;
  font-weight: 800;
}

.auth-pane {
  display: none;
  padding: 0;
}

.auth-pane.active {
  display: grid;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 360px;
  z-index: 40;
  padding: 13px 14px;
  border-radius: 8px;
  background: #10251f;
  color: white;
  box-shadow: var(--shadow);
  display: none;
}

.toast.show { display: block; }

@media (max-width: 1180px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-card { max-width: 760px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard { grid-template-columns: 1fr 1fr; }
  .operations { grid-column: 1 / -1; order: -1; }
}

@media (max-width: 780px) {
  body { font-size: 15px; }
  .site-header { align-items: flex-start; flex-direction: column; }
  .nav-actions { width: 100%; justify-content: stretch; }
  .nav-actions .btn { flex: 1 1 auto; }
  .hero, .hero-inner { min-height: auto; }
  .hero-inner { padding: 28px 14px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 15px; }
  .hero-actions, .hero-actions .btn { width: 100%; }
  .hero-card { padding: 16px; }
  .public-section { padding: 28px 14px 36px; }
  .feature-grid, .dashboard, .two-cols, .stats, .auth-grid { grid-template-columns: 1fr; }
  .dashboard { padding: 12px; }
  .modal { padding: 10px; align-items: flex-start; }
  .auth-layout { grid-template-columns: 1fr; min-height: auto; }
  .auth-side { display: none; }
  .auth-main { padding: 18px 14px 16px; }
}
