/* ShareWay – main style sheet
   Colours and sizes are set once here (in :root) and used everywhere. */

:root {
  --bg: #F5F6F3;
  --card: #FFFFFF;
  --border: #DDE3E0;
  --text: #14211E;
  --text-2: #4E5D58;
  --main: #1B365D;        /* navy blue */
  --main-hover: #13284A;
  --main-light: #E5EBF4;
  --looking-text: #7A4A00;
  --looking-bg: #FBEFD9;
  --women-text: #6B2E7A;
  --women-bg: #F3E6F6;
  --danger: #9B2C1F;

  --radius-card: 18px;
  --radius-btn: 12px;
  --font-head: "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --max: 1140px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.15;
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(30px, 5vw, 46px); }
h2 { font-size: clamp(22px, 3vw, 28px); }
h3 { font-size: 19px; }

p { margin: 0 0 14px; }
a { color: var(--main); }
.muted { color: var(--text-2); }
.small { font-size: 14px; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

.icon { width: 20px; height: 20px; flex: none; }

/* ---------- Header ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 24px;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.logo-mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--main);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.logo-mark .icon { width: 18px; height: 18px; }

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.nav a.nav-link {
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: var(--radius-btn);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a.nav-link:hover { background: var(--bg); color: var(--text); }
.nav a.nav-link.active { color: var(--main); background: var(--main-light); }

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--main-light);
  color: var(--main);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: none;
  font-size: 15px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px; min-height: 44px;
  margin-left: 4px;
  border-radius: 50%;
  text-decoration: none;
}

/* On phones, the links wrap under the logo */
@media (max-width: 720px) {
  .site-header .container { flex-direction: column; align-items: flex-start; }
  .nav { width: 100%; }
  .nav a.nav-link { padding: 10px 10px; font-size: 15px; }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 20px;
  padding-bottom: 20px;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.site-footer a {
  color: var(--text-2);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
}
.site-footer a:hover { color: var(--main); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary { background: var(--main); color: #fff; }
.btn-primary:hover { background: var(--main-hover); }
.btn-secondary { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger-text { background: none; color: var(--danger); padding-left: 0; padding-right: 0; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
}

.page { padding-top: 32px; }
.page-head { margin-bottom: 24px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label, .field .label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.field .hint { font-size: 13px; color: var(--text-2); margin-top: 4px; }
input[type="text"], input[type="tel"], input[type="date"], input[type="time"],
input[type="number"], input[type="email"], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: #fff;
  color: var(--text);
  font: inherit;
}
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible {
  outline: 3px solid var(--main-light);
  outline-offset: 1px;
  border-color: var(--main);
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row-2 { grid-template-columns: 1fr; } }

/* Choice buttons (radio styled as pills) */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: #fff;
  cursor: pointer;
  font-weight: 500;
}
.choice input:checked + span { border-color: var(--main); background: var(--main-light); color: var(--main); }
.choice input:focus-visible + span { outline: 3px solid var(--main-light); }
.choices.stack { flex-direction: column; }
.choices.stack .choice span { width: 100%; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--main); }

/* ---------- Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--main-light);
  color: var(--main);
}
.tag-looking { background: var(--looking-bg); color: var(--looking-text); }
.tag-women { background: var(--women-bg); color: var(--women-text); }
.tag-danger { background: #F8E5E2; color: var(--danger); }
.tag-muted { background: var(--bg); color: var(--text-2); }

/* A row inside a card (e.g. one join request) */
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.list-row .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-small { min-height: 44px; padding: 8px 14px; font-size: 15px; }
.request-msg { font-size: 14px; color: var(--text-2); margin: 4px 0 0; white-space: pre-line; }

/* ---------- Ride card ---------- */
.ride-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 960px) { .ride-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .ride-grid { grid-template-columns: 1fr; } }
.ride-grid.one-col { grid-template-columns: 1fr; }

.ride-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s;
}
a.ride-card:hover { border-color: var(--main); }
.ride-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ride-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ride-time { font-size: 14px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.ride-time .icon { width: 16px; height: 16px; }

.route { position: relative; padding-left: 22px; }
.route::before {
  content: "";
  position: absolute;
  left: 5px; top: 12px; bottom: 12px;
  width: 2px;
  background: var(--border);
}
.route-stop { position: relative; font-weight: 600; font-size: 17px; }
.route-stop + .route-stop { margin-top: 10px; }
.route-stop::before {
  content: "";
  position: absolute;
  left: -22px; top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--main);
  background: #fff;
}
.route-stop.to::before { background: var(--main); }

.ride-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.poster { display: flex; align-items: center; gap: 10px; min-width: 0; }
.poster-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster-country { font-size: 13px; color: var(--text-2); }
.price { text-align: right; flex: none; }
.price strong { font-family: var(--font-head); font-size: 20px; display: block; line-height: 1.1; }
.price span { font-size: 12px; color: var(--text-2); }

/* ---------- Home ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: center;
  padding: 40px 0 32px;
}
.hero p.lead { font-size: 18px; color: var(--text-2); max-width: 520px; }
.hero-points { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.hero-points li { display: flex; gap: 10px; align-items: center; color: var(--text-2); }
.hero-points .icon { color: var(--main); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 24px; } }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 24px 0 16px; }

/* ---------- Two-column layouts ---------- */
.layout-filters { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.layout-details { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.sticky { position: sticky; top: 16px; }
@media (max-width: 860px) {
  .layout-filters, .layout-details { grid-template-columns: 1fr; }
  .sticky { position: static; }
}

.narrow { max-width: 720px; margin: 0 auto; }
.text-page { max-width: 760px; }
.text-page h2 { margin-top: 28px; }
.text-page ul { padding-left: 20px; }
.text-page li { margin-bottom: 8px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  color: var(--text-2);
  padding: 12px 14px;
  min-height: 44px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--main); border-bottom-color: var(--main); }

/* ---------- Empty states / notices ---------- */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-2);
}
.empty .icon { width: 40px; height: 40px; color: var(--main); margin-bottom: 8px; }
.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-btn);
  background: var(--main-light);
  color: var(--text);
  font-size: 15px;
  margin-bottom: 16px;
}
.notice .icon { color: var(--main); margin-top: 2px; }
.notice-warn { background: var(--looking-bg); }
.notice-warn .icon { color: var(--looking-text); }

.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin: 0; }
.detail-list dt { color: var(--text-2); }
.detail-list dd { margin: 0; font-weight: 600; }

.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 22px; }

.hidden { display: none !important; }
