/* ── 99tick — light brand theme ─────────────────────────────── */
:root {
  --bg: #f7f8fd;
  --card: #ffffff;
  --line: #e6e8f2;
  --text: #14142e;
  --text-dim: #5c6178;
  --text-faint: #9aa0b6;
  --cyan: #00b8d4;
  --violet: #8b5cf6;
  --grad: linear-gradient(135deg, #00c2e0 0%, #a855f7 100%);
  --grad-btn: linear-gradient(135deg, #00b8d4, #8b5cf6);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  min-height: 100dvh;
  position: relative;
}
/* Professional mesh background */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(640px 340px at 15% -5%, rgba(0, 194, 224, 0.16), transparent 62%),
    radial-gradient(720px 380px at 88% -8%, rgba(168, 85, 247, 0.16), transparent 62%),
    radial-gradient(560px 300px at 70% 45%, rgba(0, 194, 224, 0.06), transparent 60%),
    radial-gradient(900px 480px at 30% 115%, rgba(168, 85, 247, 0.09), transparent 65%);
}
/* Fine grid, fading toward bottom */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(20, 20, 60, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 20, 60, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(900px 520px at 50% 0%, #000, transparent 78%);
  mask-image: radial-gradient(900px 520px at 50% 0%, #000, transparent 78%);
}

.hidden { display: none !important; }

/* ── Nav ────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 960px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.logo {
  font-weight: 900; font-size: 20px; color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: 8px; letter-spacing: -0.5px;
}
.logo-icon {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-size: 15px;
}
.nav-tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  background: none; border: none; cursor: pointer; white-space: nowrap;
  color: var(--text-dim); font: 700 13px Inter, sans-serif;
  padding: 8px 13px; border-radius: 10px; transition: all 0.2s;
}
.nav-tab:hover { color: var(--text); background: rgba(139, 92, 246, 0.07); }
.nav-tab.active {
  color: #fff; background: var(--grad-btn);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}
.badge {
  background: var(--violet); color: #fff; font-size: 10px; font-weight: 800;
  border-radius: 99px; padding: 1px 6px; margin-left: 4px;
}
.nav-auth { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  padding: 5px 10px; border-radius: 99px; font-size: 13px; font-weight: 700;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(0, 194, 224, 0.18), rgba(168, 85, 247, 0.18));
  color: var(--violet); font-size: 11px; font-weight: 800; text-transform: uppercase;
  overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.link-danger { background: none; border: none; color: #e11d48; cursor: pointer; font-size: 15px; }

/* ── Layout ─────────────────────────────────────────────────── */
main { max-width: 960px; margin: 0 auto; padding: 20px 16px 70px; }
.page-title { font-size: clamp(22px, 5vw, 28px); font-weight: 900; letter-spacing: -0.5px; }
.page-sub { color: var(--text-dim); font-size: 14px; margin: 6px 0 18px; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero { text-align: center; padding: 28px 0 22px; }
.pill {
  display: inline-block; margin-bottom: 14px; padding: 5px 14px; border-radius: 99px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 2px;
  background: rgba(139, 92, 246, 0.09); color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.22);
}
.hero h1 { font-size: clamp(28px, 7vw, 50px); font-weight: 900; letter-spacing: -1.5px; line-height: 1.08; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--text-dim); max-width: 520px; margin: 12px auto 0; font-size: 15px; }

/* ── Widget card ────────────────────────────────────────────── */
.widget-card {
  background: #fff; border-radius: 20px; padding: 14px 14px 6px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(90, 60, 190, 0.10);
  min-height: 160px;
}
.note { text-align: center; color: var(--text-faint); font-size: 12px; margin: 12px auto 20px; max-width: 560px; line-height: 1.5; }
.note.left { text-align: left; margin: 10px 0; }

/* Loginsiz istifadəçi üçün widget pərdəsi */
.widget-gate {
  position: absolute; inset: 0; z-index: 5; border-radius: 20px;
  background: rgba(255, 255, 255, 0.78); backdrop-filter: blur(7px);
  display: grid; place-items: center; text-align: center; padding: 24px;
}
.widget-gate-title { font-size: 20px; font-weight: 900; color: var(--text); margin-bottom: 8px; }
.widget-gate-sub { color: var(--text-dim); font-size: 13px; max-width: 380px; margin: 0 auto 16px; line-height: 1.5; }

/* ── Cards, forms ───────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 20px;
  box-shadow: 0 6px 24px rgba(20, 20, 60, 0.05);
}
.form-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; }
.section-label.cyan { color: var(--cyan); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

.field { display: block; margin-bottom: 14px; }
.field span {
  display: block; font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 2px; color: var(--text-dim); margin-bottom: 6px; padding-left: 2px;
}
.field input, .field textarea, textarea#connectMsg {
  width: 100%; padding: 0 14px; height: 48px; border-radius: 12px;
  background: #f3f4fa; border: 1px solid var(--line);
  color: var(--text); font: 500 14px Inter, sans-serif; outline: none;
  transition: all 0.2s;
}
.field textarea, textarea#connectMsg { padding: 12px 14px; height: auto; resize: vertical; }
.field input:focus, .field textarea:focus, textarea#connectMsg:focus {
  border-color: rgba(139, 92, 246, 0.5); background: #fff;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }

.toggle {
  width: 44px; height: 24px; border-radius: 99px; position: relative; flex-shrink: 0;
  background: #d8dbe8; transition: background 0.2s;
}
.toggle::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.toggle.on { background: var(--violet); }
.toggle.on::after { left: 24px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  border: none; cursor: pointer; border-radius: 12px;
  font: 700 14px Inter, sans-serif; padding: 13px 22px; transition: all 0.2s;
}
.btn-primary {
  background: var(--grad-btn); color: #fff;
  box-shadow: 0 8px 22px rgba(139, 92, 246, 0.32);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(139, 92, 246, 0.42); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: #fff; color: var(--text-dim);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: rgba(139, 92, 246, 0.4); color: var(--violet); }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn {
  background: #eef0f7; border: none; color: var(--text-dim);
  width: 30px; height: 30px; border-radius: 10px; cursor: pointer;
}
.link { background: none; border: none; color: var(--violet); cursor: pointer; font: 700 13px Inter, sans-serif; }

/* ── Lounge / Lists ─────────────────────────────────────────── */
.lounge-layout, .msg-layout {
  display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start;
}
@media (max-width: 720px) { .lounge-layout, .msg-layout { grid-template-columns: 1fr; } }

.trip-list, .request-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.trip-item, .request-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; cursor: pointer; transition: all 0.2s; text-align: left; width: 100%;
  color: var(--text); font-family: Inter, sans-serif;
  box-shadow: 0 4px 14px rgba(20, 20, 60, 0.04);
}
.trip-item:hover, .request-item:hover { border-color: rgba(139, 92, 246, 0.45); }
.trip-item.active, .request-item.active {
  border-color: var(--violet);
  background: linear-gradient(135deg, rgba(0, 194, 224, 0.05), rgba(168, 85, 247, 0.07));
}
.trip-route { font-weight: 900; font-size: 16px; overflow-wrap: anywhere; }
.trip-meta { color: var(--text-dim); font-size: 12px; margin-top: 3px; }
.tag {
  display: inline-block; font-size: 9px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; border-radius: 99px; padding: 2px 8px; margin-left: 6px;
}
.tag.cyan { background: rgba(0, 184, 212, 0.12); color: #0e7490; }
.tag.violet { background: rgba(139, 92, 246, 0.13); color: #7c3aed; }
.tag.amber { background: rgba(245, 158, 11, 0.15); color: #b45309; }

.mini-toggle {
  margin-top: 8px; font: 700 11px Inter, sans-serif; cursor: pointer;
  border: 1px solid var(--line); background: #f3f4fa; color: var(--text-dim);
  border-radius: 99px; padding: 5px 10px; transition: all 0.2s;
}
.mini-toggle:hover { border-color: rgba(139, 92, 246, 0.4); color: var(--violet); }

.co-panel, .chat-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  min-height: 320px; padding: 18px; min-width: 0;
  box-shadow: 0 6px 24px rgba(20, 20, 60, 0.05);
}
.person {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: 14px; border: 1px solid var(--line); margin-bottom: 10px;
  background: #fbfbfe; flex-wrap: wrap;
}
.person .avatar { width: 42px; height: 42px; font-size: 14px; }
.person-info { flex: 1; min-width: 140px; }
.person-name { font-weight: 800; font-size: 14px; }
.person-sub { color: var(--text-faint); font-size: 12px; }

/* ── Chat ───────────────────────────────────────────────────── */
.chat-panel { display: flex; flex-direction: column; max-height: min(560px, 75dvh); }
.chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.chat-body { flex: 1; overflow-y: auto; padding: 14px 4px; display: flex; flex-direction: column; gap: 8px; }
.bubble {
  max-width: 80%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.45;
  background: #eef0f7; color: var(--text); align-self: flex-start;
  border-bottom-left-radius: 4px; overflow-wrap: anywhere;
}
.bubble.mine {
  background: linear-gradient(135deg, rgba(0, 194, 224, 0.14), rgba(168, 85, 247, 0.16));
  border: 1px solid rgba(139, 92, 246, 0.2);
  align-self: flex-end; border-bottom-left-radius: 16px; border-bottom-right-radius: 4px;
}
.bubble time { display: block; font-size: 10px; color: var(--text-faint); margin-top: 3px; }
.chat-input { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.chat-input input {
  flex: 1; height: 44px; border-radius: 12px; padding: 0 14px; min-width: 0;
  background: #f3f4fa; border: 1px solid var(--line);
  color: var(--text); font: 500 14px Inter, sans-serif; outline: none;
}
.accept-row { display: flex; gap: 8px; margin-top: 10px; }
.btn-accept { flex: 1; background: var(--grad-btn); color: #fff; border: none; padding: 10px; border-radius: 10px; font-weight: 800; cursor: pointer; }
.btn-reject { flex: 1; background: rgba(225, 29, 72, 0.07); color: #e11d48; border: 1px solid rgba(225, 29, 72, 0.25); padding: 10px; border-radius: 10px; font-weight: 800; cursor: pointer; }

/* ── Profile ────────────────────────────────────────────────── */
.avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.avatar-row .avatar { width: 64px; height: 64px; font-size: 20px; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(20, 20, 46, 0.45); backdrop-filter: blur(6px); padding: 16px;
}
.modal {
  width: 100%; max-width: 420px; border-radius: 24px; padding: 24px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(20, 20, 60, 0.25);
  max-height: 85dvh; overflow-y: auto;
}
.modal.wide { max-width: 640px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h3 { font-size: 18px; font-weight: 900; }
.auth-switch { text-align: center; margin-top: 14px; font-size: 13px; color: var(--text-dim); }
.legal-body { font-size: 13px; color: var(--text-dim); line-height: 1.65; }
.legal-body h4 { color: var(--text); margin: 14px 0 4px; font-size: 14px; }

/* ── Filters (Flights) ──────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px; margin-bottom: 16px;
  box-shadow: 0 6px 24px rgba(20, 20, 60, 0.05);
}
.filter-field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 130px; }
.filter-field label {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 2px; color: var(--text-dim); padding-left: 2px;
}
.filter-field input[type="date"], .select-wrap select {
  height: 44px; border-radius: 12px; padding: 0 14px; width: 100%;
  background: #f3f4fa; border: 1px solid var(--line);
  color: var(--text); font: 600 14px Inter, sans-serif; outline: none;
  transition: all 0.2s; -webkit-appearance: none; appearance: none;
}
.filter-field input[type="date"]:focus, .select-wrap select:focus {
  border-color: rgba(139, 92, 246, 0.5); background: #fff;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}
.filter-field input[type="date"] { accent-color: #8b5cf6; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 14px; top: 50%; transform: translateY(-70%) rotate(45deg);
  width: 8px; height: 8px; border-right: 2px solid var(--text-dim); border-bottom: 2px solid var(--text-dim);
  pointer-events: none;
}
.select-wrap select { padding-right: 36px; cursor: pointer; }
#fltClear { height: 44px; }
@media (max-width: 640px) {
  .filter-bar { padding: 12px; gap: 10px; }
  .filter-field { min-width: calc(50% - 10px); }
  #fltClear { width: 100%; }
}

/* ── How it works popup ─────────────────────────────────────── */
.how-steps { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.how-step { display: flex; gap: 12px; align-items: flex-start; }
.how-icon {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(0, 194, 224, 0.12), rgba(168, 85, 247, 0.14));
  color: #7c3aed;
}
.how-step strong { font-size: 14px; display: block; margin-bottom: 2px; }
.how-step p { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }

/* ── Icon helpers ───────────────────────────────────────────── */
.ic { vertical-align: -2px; display: inline-block; }

/* ── Misc ───────────────────────────────────────────────────── */
.empty { color: var(--text-dim); font-size: 14px; text-align: center; padding: 30px 10px; }
.empty .btn { margin-top: 12px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: #14142e; color: #fff; border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 12px 20px; border-radius: 14px; font-size: 14px; font-weight: 600;
  box-shadow: 0 12px 40px rgba(20, 20, 60, 0.35); max-width: 90vw;
}
.toast.error { border-color: rgba(225, 29, 72, 0.6); }
.footer {
  text-align: center; color: var(--text-faint); font-size: 12px; padding: 22px 16px 36px;
  border-top: 1px solid var(--line);
}
.footer a, .footer .link { color: var(--violet); text-decoration: none; font-size: 12px; }

/* ── Mobile polish ──────────────────────────────────────────── */
@media (max-width: 640px) {
  main { padding: 14px 12px 60px; }
  /* iOS: input fokuslananda avtomatik zoom-un qarşısı (font ≥16px olmalıdır) */
  .field input, .field textarea, textarea#connectMsg,
  .chat-input input, .filter-field input[type="date"],
  .select-wrap select {
    font-size: 16px;
  }
  .nav-inner { gap: 8px; }
  .nav-tabs { order: 3; flex-basis: 100%; }
  .hero { padding: 18px 0 16px; }
  .widget-card { padding: 10px 8px 4px; border-radius: 16px; }
  .card { padding: 16px; }
  .co-panel, .chat-panel { padding: 14px; }
  .btn { padding: 12px 16px; }
}
