:root {
  --bg: #070708;
  --bg-soft: #101012;
  --glass: rgba(28, 28, 31, 0.66);
  --glass-strong: rgba(40, 40, 43, 0.76);
  --glass-light: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.13);
  --line-soft: rgba(255, 255, 255, 0.08);
  --white: #fbfbfa;
  --muted: #aaa9ad;
  --dim: #77767b;
  --red: #ed1717;
  --red-bright: #ff3833;
  --red-soft: rgba(237, 23, 23, 0.16);
  --green: #66d39a;
  --radius: 20px;
  --radius-sm: 13px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }

html {
  scrollbar-width: thin;
  scrollbar-color: var(--red) #111113;
}
html::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track { background: #111113; border-left: 1px solid rgba(255,255,255,.05); }
html::-webkit-scrollbar-thumb { border: 2px solid #111113; border-radius: 999px; background: linear-gradient(180deg, var(--red-bright), var(--red)); }
html::-webkit-scrollbar-thumb:hover { background: #ff4b46; }

body {
  min-height: 100vh;
  color: var(--white);
  background:
    radial-gradient(850px 520px at 5% -10%, rgba(237, 23, 23, 0.16), transparent 63%),
    radial-gradient(700px 500px at 100% 100%, rgba(255, 255, 255, 0.045), transparent 62%),
    var(--bg);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}
a { color: var(--white); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--red-bright); }
button, input { font: inherit; }
button { cursor: pointer; border: 0; outline: 0; }

/* Shared brand */
.brand { text-align: center; margin-bottom: 30px; }
.brand .logo, .topbar .logo { display: inline-flex; align-items: center; gap: 13px; font-weight: 700; letter-spacing: .12em; }
.brand .logo { font-size: 18px; }
.logo-image { width: 68px; height: 48px; object-fit: contain; object-position: center; filter: drop-shadow(0 7px 17px rgba(237, 23, 23, .2)); }
.topbar .logo-image { width: 56px; height: 38px; }
.brand .tagline { margin-top: 10px; color: var(--muted); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; }

/* Auth */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 44px 20px; position: relative; overflow: hidden;
}
.auth-wrap::after {
  content: ""; position: absolute; width: 420px; height: 420px; right: -180px; top: 15%;
  border: 1px solid rgba(237,23,23,.18); border-radius: 50%; box-shadow: 0 0 0 38px rgba(237,23,23,.025), 0 0 0 76px rgba(237,23,23,.018);
  pointer-events: none;
}
.card {
  width: 100%; max-width: 470px; position: relative; z-index: 1; padding: 40px 36px 32px;
  border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(45,45,49,.72), rgba(17,17,19,.72));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.08); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.card::before { content: ""; position: absolute; left: 15%; right: 15%; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--red), transparent); }
.card h1 { font-size: clamp(26px, 4vw, 32px); line-height: 1.12; letter-spacing: -.055em; margin-bottom: 8px; }
.card .sub { color: var(--muted); font-size: 14px; margin-bottom: 30px; }
.field { margin-bottom: 17px; }
.field label { display: block; margin: 0 0 8px 2px; color: #d3d2d4; font-size: 11px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.field .input-wrap { display: flex; min-height: 52px; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(0,0,0,.23); transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.field .input-wrap:focus-within { border-color: rgba(255,56,51,.8); background: rgba(0,0,0,.34); box-shadow: 0 0 0 4px var(--red-soft); }
.field .prefix { display: inline-flex; align-items: center; padding: 0 15px; color: #e5e4e6; font-size: 14px; font-weight: 600; border-right: 1px solid var(--line); background: rgba(255,255,255,.045); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.field input { flex: 1; width: 100%; min-width: 0; padding: 13px 15px; color: var(--white); border: 0; outline: 0; background: transparent; font-size: 14px; }
.field input::placeholder { color: var(--dim); }
.btn { display: inline-flex; width: 100%; align-items: center; justify-content: center; gap: 9px; padding: 15px 18px; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: 14px; font-weight: 700; transition: transform .2s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease; }
.btn-primary { color: white; background: linear-gradient(135deg, var(--red-bright), var(--red)); box-shadow: 0 12px 28px rgba(237,23,23,.22), inset 0 1px 0 rgba(255,255,255,.22); }
.btn-primary:hover { background: linear-gradient(135deg, #ff4b46, #e10d0d); transform: translateY(-2px); box-shadow: 0 16px 32px rgba(237,23,23,.3), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:active { transform: translateY(0); }
.btn:disabled { opacity: .65; cursor: wait; transform: none; }
.link-row { margin-top: 24px; padding-top: 21px; border-top: 1px solid var(--line-soft); color: var(--muted); text-align: center; font-size: 13px; }
.link-row a { color: #ff6862; font-weight: 600; }
.alert { display: none; padding: 12px 14px; margin-bottom: 18px; border: 1px solid; border-radius: var(--radius-sm); font-size: 13px; }
.alert.show { display: block; }
.alert.error { color: #ffaaa6; background: rgba(237,23,23,.1); border-color: rgba(255,56,51,.38); }
.alert.success { color: #a5edc2; background: rgba(61,187,117,.1); border-color: rgba(102,211,154,.35); }

/* Dashboard */
.dash { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 13px 34px; border-bottom: 1px solid var(--line-soft); background: rgba(8,8,9,.7); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
.topbar .logo { font-size: 14px; letter-spacing: .16em; }
.topbar .actions { display: flex; align-items: center; gap: 16px; }
.topbar .logout { padding: 9px 15px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.035); font-size: 12px; font-weight: 600; transition: all .2s ease; }
.topbar .logout:hover { color: white; border-color: rgba(255,56,51,.6); background: var(--red-soft); }
.container { width: min(1160px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 70px; }
.profile { position: relative; display: flex; align-items: center; gap: 22px; overflow: hidden; padding: 28px 30px; margin-bottom: 48px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(115deg, rgba(56,56,61,.65), rgba(18,18,20,.6)); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.08); backdrop-filter: blur(20px); }
.profile::after { content: ""; position: absolute; width: 260px; height: 260px; top: -140px; right: 8%; border-radius: 50%; border: 1px solid rgba(237,23,23,.2); box-shadow: 0 0 0 25px rgba(237,23,23,.025), 0 0 0 50px rgba(237,23,23,.018); }
.avatar { position: relative; z-index: 1; display: grid; width: 72px; height: 72px; flex-shrink: 0; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; color: white; background: linear-gradient(145deg, var(--red-bright), #9e0808); box-shadow: 0 10px 28px rgba(237,23,23,.3), inset 0 1px 0 rgba(255,255,255,.25); font-size: 25px; font-weight: 800; }
.profile .info { position: relative; z-index: 1; }
.profile .info .name { margin-bottom: 6px; font-size: 23px; font-weight: 700; letter-spacing: -.04em; }
.profile .info .meta { display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--muted); font-size: 12px; }
.profile .info .meta span { display: inline-flex; align-items: center; gap: 6px; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 22px; }
.section-head h2 { font-size: 27px; letter-spacing: -.05em; }
.section-head .count { padding: 6px 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.045); font-size: 11px; }
.trips { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.trip { overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(150deg, rgba(41,41,44,.67), rgba(17,17,19,.72)); box-shadow: 0 18px 50px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.055); backdrop-filter: blur(16px); transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.trip:hover { transform: translateY(-6px); border-color: rgba(255,56,51,.46); box-shadow: 0 24px 58px rgba(0,0,0,.42), 0 0 0 1px rgba(237,23,23,.05); }
.trip .img { height: 190px; position: relative; background-position: center; background-size: cover; }
.trip .img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.02) 28%, rgba(5,5,6,.78) 100%); }
.trip .price-tag { position: absolute; z-index: 2; top: 14px; right: 14px; padding: 7px 12px; color: white; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(0,0,0,.44); backdrop-filter: blur(12px); font-size: 12px; font-weight: 700; }
.trip .body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 22px; }
.trip .body h3 { font-size: 18px; letter-spacing: -.025em; }
.trip .body .desc { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.trip .meta-row { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 3px; color: #c3c2c5; font-size: 11px; }
.trip .meta-row span { display: inline-flex; align-items: center; gap: 5px; }
.trip .seats { color: var(--dim); font-size: 11px; margin-top: 4px; }
.trip .bar { height: 4px; overflow: hidden; margin-top: -2px; border-radius: 999px; background: rgba(255,255,255,.09); }
.trip .bar > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red), var(--red-bright)); transition: width .4s ease; }
.trip .actions { margin-top: auto; padding-top: 14px; }
.trip .btn { padding: 12px; font-size: 13px; }
.trip .registered-badge { padding: 11px; color: var(--green); border: 1px solid rgba(102,211,154,.27); border-radius: var(--radius-sm); background: rgba(102,211,154,.08); text-align: center; font-size: 13px; font-weight: 600; }
.empty { grid-column: 1 / -1; padding: 80px 20px; color: var(--muted); text-align: center; }
.empty .ico { margin-bottom: 12px; color: var(--red-bright); font-size: 34px; opacity: .75; }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.1), rgba(255,255,255,.05)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.3); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; z-index: 100; bottom: 28px; left: 50%; padding: 13px 20px; border: 1px solid var(--line); border-radius: 999px; color: var(--white); background: rgba(37,37,40,.82); box-shadow: var(--shadow); backdrop-filter: blur(18px); opacity: 0; pointer-events: none; transform: translate(-50%, 18px); transition: all .25s ease; font-size: 13px; font-weight: 600; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.success { color: #a5edc2; border-color: rgba(102,211,154,.4); }
.toast.error { color: #ffaaa6; border-color: rgba(255,56,51,.4); }

@media (max-width: 600px) {
  .card { padding: 32px 22px 26px; }
  .topbar { padding: 11px 17px; }
  .topbar .logo { gap: 8px; font-size: 11px; }
  .topbar .logo-image { width: 48px; height: 33px; }
  .container { width: min(100% - 32px, 1160px); padding-top: 28px; }
  .profile { align-items: flex-start; flex-direction: column; padding: 24px; }
  .profile .info .name { font-size: 21px; }
  .section-head h2 { font-size: 23px; }
  .trips { grid-template-columns: 1fr; }
}

/* .lang-btn {
  position: relative;
  min-width: 64px;
  padding: 9px 16px 9px 30px;
  overflow: hidden;
  color: var(--white);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 8px 24px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  transition: all .25s ease;
  cursor: pointer;
}
.lang-btn::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 50%;
  width: 11px;
  height: 11px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transform: translateY(-50%);
  opacity: .9;
}
.lang-btn::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-50%);
  opacity: .9;
}
.lang-btn:hover {
  color: white;
  border-color: rgba(255,56,51,.8);
  background: linear-gradient(135deg, rgba(237,23,23,.28), rgba(237,23,23,.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 8px 26px rgba(237,23,23,.22), 0 0 0 3px rgba(237,23,23,.08);
  transform: translateY(-1px);
} */


.lang-btn {
  position: relative;
  min-width: 64px;
  padding: 9px 16px 9px 30px;
  overflow: hidden;
  color: var(--white);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 8px 24px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  transition: all .25s ease;
  cursor: pointer;
}
.lang-btn::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 50%;
  width: 11px;
  height: 11px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transform: translateY(-50%);
  opacity: .9;
}
.lang-btn::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-50%);
  opacity: .9;
}
.lang-btn:hover {
  color: white;
  border-color: rgba(255,56,51,.8);
  background: linear-gradient(135deg, rgba(237,23,23,.28), rgba(237,23,23,.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 8px 26px rgba(237,23,23,.22), 0 0 0 3px rgba(237,23,23,.08);
  transform: translateY(-1px);
}
.lang-btn:active { transform: translateY(0); }
.lang-btn:focus-visible { outline: 2px solid var(--red-bright); outline-offset: 3px; }
[dir="rtl"] .lang-btn { padding-right: 30px; padding-left: 16px; }
[dir="rtl"] .lang-btn::before { right: 11px; left: auto; }
[dir="rtl"] .lang-btn::after { right: 14px; left: auto; }
.auth-lang { position: fixed; top: 22px; right: 22px; z-index: 50; }
[dir="rtl"] .auth-lang { right: auto; left: 22px; }