/* Magic Airlines – Web-Ansicht. Stahlblau ↔ Gold wie in der iOS-App. */
@font-face { font-family: "GreatVibes"; src: url("GreatVibes-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --primary: #3e628e;
  --primary-dark: #2b4566;
  --gold: #b08a3d;
  --gold-soft: rgba(176, 138, 61, .12);
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #1c2633;
  --muted: #677385;
  --line: rgba(28, 38, 51, .09);
  --danger: #c0392b;
  --success: #2e9d5b;
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1520; --card: #182131; --text: #eef2f7; --muted: #9aa6b6; --line: rgba(255,255,255,.08); }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: linear-gradient(rgba(243,245,248,.55), rgba(243,245,248,.82)), url("app-bg.jpg") center / cover fixed;
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: linear-gradient(120deg, var(--primary-dark), var(--primary) 70%, #6b5a35);
  color: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.brand { flex: 1; min-width: 0; font-family: "GreatVibes", cursive; font-size: 30px; line-height: 1.1; color: #e4c98a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar select { width: auto; flex: none; background: rgba(255,255,255,.15); border: 0; border-radius: 10px; padding: 6px 8px; color: #fff; }
.topbar select option { color: #000; }
.icon-btn { flex: none; background: rgba(255,255,255,.15); border: 0; color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 26px; line-height: 1; cursor: pointer; }

main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 26px; margin: 4px 0 6px; }
h2 { font-size: 19px; margin: 22px 0 10px; }
h3 { font-size: 16px; margin: 0 0 4px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 12px; }
.card.gold { background: var(--gold-soft); border: 1.2px dashed rgba(176,138,61,.5); box-shadow: none; }

.field { display: block; margin: 10px 0; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 12px 18px; font-weight: 650; cursor: pointer;
  background: linear-gradient(120deg, var(--primary), #8a7746); color: #fff; width: 100%;
}
.btn.secondary { background: var(--bg); color: var(--primary); border: 1px solid var(--line); }
.btn.small { width: auto; padding: 8px 14px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: default; }
.link-btn { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 8px 0; font-weight: 600; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.error { color: var(--danger); font-size: 14px; margin-top: 8px; }

.segmented { display: flex; background: var(--bg); border-radius: 12px; padding: 3px; margin-bottom: 8px; }
.segmented button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 10px; font-weight: 600; cursor: pointer; color: var(--muted); }
.segmented button.active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* Reisen */
.trip-card { display: flex; gap: 14px; align-items: center; cursor: pointer; }
.trip-thumb { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; background: var(--gold-soft); flex: none; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--gold-soft); color: var(--gold); }
.badge.blue { background: rgba(62,98,142,.12); color: var(--primary); }

.hero { position: relative; border-radius: 22px; overflow: hidden; min-height: 210px; background: linear-gradient(120deg, var(--primary-dark), var(--primary)); margin-bottom: 14px; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0) 60%); }
.hero .info { position: absolute; left: 18px; right: 18px; bottom: 16px; color: #fff; }
.hero h1 { margin: 0; font-size: 30px; }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 99px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tabs button.active { background: linear-gradient(120deg, var(--primary), #8a7746); color: #fff; border-color: transparent; }

/* Reiseplan */
.day-head { font-weight: 700; margin: 18px 0 8px; color: var(--primary); text-transform: capitalize; }
.item { display: flex; gap: 12px; }
.item .time { width: 56px; flex: none; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; padding-top: 2px; }
.item .emoji { font-size: 22px; line-height: 1; }
.car { border-left: 4px solid var(--carColor, var(--primary)); padding: 8px 12px; margin-top: 8px; border-radius: 8px; background: var(--bg); }
.chip { display: inline-block; font-size: 13px; padding: 3px 9px; margin: 3px 4px 0 0; border-radius: 99px; background: var(--card); border: 1px solid var(--line); }
.chip.driver { background: var(--carColor, var(--primary)); color: #fff; border-color: transparent; }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 16px; background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.06); word-wrap: break-word; }
.msg.mine { align-self: flex-end; background: linear-gradient(120deg, var(--primary), #6e7c8f); color: #fff; }
.msg .who { font-size: 12px; font-weight: 700; color: var(--gold); }
.msg .when { font-size: 11px; opacity: .7; margin-top: 2px; }
.msg .report { background: none; border: 0; font-size: 11px; color: var(--muted); cursor: pointer; padding: 0; margin-left: 6px; }
.composer { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: var(--bg); }
.composer input { flex: 1; }
.composer .btn { width: auto; }

/* Packliste */
.check { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.box { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--muted); flex: none; display: grid; place-items: center; color: #fff; font-size: 14px; }
.check.done .box { background: var(--success); border-color: var(--success); }
.check.done .title { text-decoration: line-through; color: var(--muted); }

/* Ausgaben */
.money { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.checks label { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.checks input { width: auto; }

#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: rgba(20,28,40,.92); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 90%; z-index: 20; }
.center { text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.footer { text-align: center; font-size: 13px; color: var(--muted); margin: 26px 0 10px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 30; }
.modal { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
.modal img { max-width: 100%; border-radius: 12px; }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 22px; } }

@media (prefers-color-scheme: dark) {
  body { background: linear-gradient(rgba(15,21,32,.72), rgba(15,21,32,.9)), url("app-bg.jpg") center / cover fixed; }
}

/* Anmeldung wie in der App: Flugzeug-Hintergrund, Logo, Signatur, Milchglas */
body.auth { background: #1d2c40 url("login-bg.jpg") center / cover fixed; }
body.auth .topbar { background: transparent; box-shadow: none; position: absolute; left: 0; right: 0; }
body.auth .topbar .brand { visibility: hidden; }
body.auth main { padding-top: calc(70px + env(safe-area-inset-top)); }
.auth-hero { text-align: center; color: #fff; margin: 10px 0 22px; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.auth-hero .logo { width: 92px; height: 92px; border-radius: 22px; object-fit: cover; clip-path: inset(5% round 20px); transform: scale(1.1); filter: drop-shadow(0 10px 22px rgba(0,0,0,.35)); }
.auth-hero .signature { font-family: "GreatVibes", cursive; font-size: 58px; line-height: 1; margin: 6px 0 -14px; }
.auth-hero .title { font-size: 34px; font-weight: 800; letter-spacing: .3px; margin: 0; }
.auth-hero .slogan { font-size: 15px; opacity: .92; margin: 6px 12px 0; }
.glass { background: rgba(255,255,255,.72); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border: 1px solid rgba(255,255,255,.5); }
@media (prefers-color-scheme: dark) { .glass { background: rgba(24,33,49,.72); border-color: rgba(255,255,255,.12); } }
body.auth .footer, body.auth .footer a { color: rgba(255,255,255,.9); }
body.auth .intro { color: #fff; text-align: center; font-size: 15px; margin: -8px 8px 14px; text-shadow: 0 1px 6px rgba(0,0,0,.4); }

.hero .credit { position: absolute; right: 8px; top: 8px; font-size: 9px; color: rgba(255,255,255,.85); background: rgba(0,0,0,.28); padding: 2px 7px; border-radius: 99px; max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .credit:empty { display: none; }
