:root {
  --bg: #f4f0ea;
  --surface: #ffffff;
  --ink: #0c0c0e;
  --muted: #6b6b70;
  --border: rgba(12, 12, 14, 0.12);
  --accent: #1a5ad9;
  --accent-soft: rgba(26, 90, 217, 0.12);
  --accent-2: #f06728;
  --radius: 18px;
  --shadow: 0 24px 60px -40px rgba(12, 12, 14, 0.6);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: radial-gradient(circle at top left, #f9f5ef 0%, #f1ebe3 45%, #efe7dd 100%);
  color: var(--ink);
  min-height: 100vh;
}

.app {
  padding: 24px 16px 96px;
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  background: linear-gradient(140deg, #15181f 0%, #1f2a36 35%, #223a59 100%);
  color: #fefefe;
  padding: 28px;
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.hero-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-card-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
  margin-bottom: 12px;
}

.hero-actions {
  display: grid;
  gap: 10px;
}

.badge {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.7);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 42px);
}

.lead {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
}

.main {
  margin-top: 24px;
  display: grid;
  gap: 18px;
  flex: 1;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px -45px rgba(10, 10, 20, 0.5);
}

h2, h3 {
  margin: 0 0 12px;
}

p {
  margin: 0;
}

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

.stack {
  display: grid;
  gap: 12px;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.row.wrap > * {
  flex: 1 1 160px;
}

.row.space-between {
  justify-content: space-between;
}

label {
  font-weight: 600;
  font-size: 14px;
}

input, select, textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  background: #f9f6f2;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 90, 217, 0.15);
}

.button, .cta, .big, .mode-btn, .bottom-nav button {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.button.secondary {
  background: var(--accent-soft);
  color: var(--accent);
}

.button:hover, .cta:hover, .big:hover, .mode-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -18px rgba(26, 90, 217, 0.7);
}

.cta.ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.big-buttons {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.big {
  font-size: 16px;
  padding: 18px;
}

.big.alt {
  background: var(--accent-2);
}

.mode-toggle {
  display: inline-flex;
  background: #f2ece5;
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.mode-btn {
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: none;
}

.mode-btn.active {
  background: var(--accent);
  color: #fff;
}

.grid {
  display: grid;
  gap: 14px;
}

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

.list-card {
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 16px;
  background: #fdfaf6;
  display: grid;
  gap: 8px;
}

.list-card .title {
  font-weight: 600;
}

.status {
  font-size: 14px;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 14px 14px;
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.bottom-nav button {
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  padding: 6px 4px;
  box-shadow: none;
}

.bottom-nav button.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 54px;
}

.nav-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.nav-plus {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--accent-2);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-18px);
  box-shadow: 0 16px 30px -18px rgba(0, 0, 0, 0.6);
}

.nav-plus span {
  transform: translateY(-2px);
}

.badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #e11d48;
  border-radius: 999px;
  margin-left: 6px;
}

.mobile-tabs {
  display: none;
  gap: 10px;
  padding: 12px 16px 0;
  position: sticky;
  top: 0;
  z-index: 15;
  background: transparent;
}

.tab-btn {
  flex: 1;
  border-radius: 999px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: #f6f1ea;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
}

.chips {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f9f6f2;
  border: 1px solid var(--border);
  min-height: 44px;
}

.chip input {
  margin: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.chip .button {
  padding: 6px 10px;
  font-size: 12px;
}

.image-picker {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
}

.image-tile {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px dashed var(--border);
  background: #f9f6f2;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--muted);
}

.image-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-tile .remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #dc2626;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.image-tile.add {
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

@media (max-width: 720px) {
  body.mode-provider .provider-card {
    background: #1b2432;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f4f6fb;
  }

  body.mode-provider .provider-card h2,
  body.mode-provider .provider-card label,
  body.mode-provider .provider-card .muted {
    color: #d9e1ee;
  }

  body.mode-provider .provider-card input,
  body.mode-provider .provider-card textarea,
  body.mode-provider .provider-card select {
    background: #131b26;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f4f6fb;
  }

  body.mode-provider .provider-card .chip {
    background: #131b26;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f4f6fb;
  }

  body.mode-provider .provider-card .chip input {
    accent-color: var(--accent-2);
  }

  body.mode-provider .provider-card .button {
    background: #f49a23;
    color: #1b1b1b;
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-card {
  background: #fff;
  max-width: 640px;
  width: 100%;
  padding: 22px;
  border-radius: 20px;
  display: grid;
  gap: 12px;
}

.inbox-layout {
  display: grid;
  gap: 16px;
}

.toast {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 12, 0.35);
  z-index: 60;
}

.toast-card {
  background: #111827;
  color: #fff;
  padding: 18px 22px;
  border-radius: 14px;
  box-shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.toast-title {
  font-weight: 600;
}

.toast-sub {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 6px;
}

.terms-text {
  font-size: 14px;
  color: #1f1f22;
  line-height: 1.5;
}

.check {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

.check input {
  width: auto;
}

.mode-provider {
  --accent: #f06728;
  --accent-soft: rgba(240, 103, 40, 0.12);
  background: radial-gradient(circle at top left, #fff1e8 0%, #fde6d8 45%, #f9dcc8 100%);
}

.mode-seeker {
  --accent: #1a5ad9;
  --accent-soft: rgba(26, 90, 217, 0.12);
  background: radial-gradient(circle at top left, #eef4ff 0%, #e5efff 45%, #dfe9ff 100%);
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 2fr 1fr;
    align-items: center;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .inbox-layout {
    grid-template-columns: 1fr 2fr;
    align-items: start;
  }
}

@media (max-width: 900px) {
  body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  .app {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }
  .main {
    overflow-y: auto;
    padding-bottom: 24px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    min-height: 0;
  }
  body.logged-out .hero {
    display: none;
  }
  body.logged-out .bottom-nav {
    display: none;
  }
  body.logged-in .mobile-tabs {
    display: flex;
  }
  body.logged-in #view-dashboard {
    display: none !important;
  }
  .bottom-nav {
    padding-bottom: 18px;
  }
  input, select, textarea {
    font-size: 16px;
  }
}
