/* hub.css – Kundenportal; Tokens identisch zu fahrdaten palette.css/app.css */
:root {
  --bg-0: #0e121a;
  --bg-1: #161c28;
  --surface: rgba(25,31,45,0.94);
  --surface-border: rgba(255,255,255,0.11);
  --field: rgba(255,255,255,0.055);
  --field-border: rgba(255,255,255,0.15);
  --text: #f1f4fb;
  --text-dim: #ccd4e2;
  --text-faint: #98a3b7;
  --accent: #007bff;
  --accent-2: #4dabf7;
  --accent-soft: rgba(0,123,255,0.18);
  --danger: #d32f2f;
  --ok: #4caf50;
  --radius: 16px;
  --radius-sm: 11px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", system-ui, sans-serif;
}
:root[data-theme="light"] {
  --bg-0: #eef1f7;
  --bg-1: #e3e8f3;
  --surface: rgba(255,255,255,0.80);
  --surface-border: rgba(22,32,58,0.10);
  --field: rgba(22,32,58,0.035);
  --field-border: rgba(22,32,58,0.16);
  --text: #16203a;
  --text-dim: #41506b;
  --text-faint: #6b788f;
  --accent-soft: rgba(0,123,255,0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--font-body); color: var(--text); background: var(--bg-0);
  min-height: 100dvh; position: relative; -webkit-font-smoothing: antialiased;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
a { color: inherit; }

/* ---- Hintergrund ---- */
.aura {
  position: fixed; inset: -20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40% 50% at 20% 25%, rgba(0,123,255,0.30), transparent 70%),
    radial-gradient(35% 45% at 82% 18%, rgba(77,171,247,0.22), transparent 70%),
    radial-gradient(45% 55% at 75% 88%, rgba(0,180,216,0.16), transparent 70%),
    linear-gradient(160deg, var(--bg-1), var(--bg-0));
  filter: blur(28px); opacity: .42;
  animation: drift 22s var(--ease) infinite alternate;
}
:root[data-theme="light"] .aura { opacity: .45; filter: blur(34px); }
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-3%,2%,0) scale(1.08); } }
.grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 40%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, black, transparent 80%);
}
:root[data-theme="light"] .grid {
  background-image:
    linear-gradient(rgba(22,32,58,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22,32,58,0.05) 1px, transparent 1px);
}

/* ---- Marke ---- */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand .mark { width: 34px; height: 34px; border-radius: 8px; overflow: hidden; flex: none; }
.brand .mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand .b-text { display: flex; flex-direction: column; min-width: 0; }
.brand .b-firm { font-size: 12.5px; line-height: 1.25; color: var(--text-dim); white-space: nowrap; }
.brand .b-app { font-size: 13px; line-height: 1.25; font-weight: 600; white-space: nowrap; }

/* ---- Anmeldung ---- */
body.auth { display: flex; align-items: center; justify-content: center; padding: 24px; }
.card {
  position: relative; z-index: 1; width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius);
  padding: 36px 32px 26px;
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 30px 80px -20px rgba(0,0,0,0.55);
  animation: rise .7s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.card .brand { margin-bottom: 26px; }
.card h1 { font-family: var(--font-display); font-size: 25px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 6px; }
.card .sub { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }
.card .foot { margin-top: 18px; font-size: 12.5px; color: var(--text-faint); text-align: center; }

.formmsg { font-size: 13.5px; margin: 0 0 16px; padding: 10px 13px; border-radius: var(--radius-sm); border: 1px solid var(--field-border); background: var(--field); }
.formmsg.err { border-color: var(--danger); color: var(--danger); background: rgba(211,47,47,0.08); }
.formmsg.ok { border-color: var(--ok); color: var(--ok); background: rgba(76,175,80,0.10); }

.field { position: relative; margin-bottom: 16px; }
.field input {
  width: 100%; height: 54px; padding: 22px 16px 8px; font-size: 15px; font-family: inherit;
  color: var(--text); background: var(--field); border: 1px solid var(--field-border);
  border-radius: var(--radius-sm); outline: none;
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.field input::placeholder { color: transparent; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field label { position: absolute; left: 16px; top: 17px; font-size: 15px; color: var(--text-faint); pointer-events: none; transition: all .18s var(--ease); }
.field input:focus + label, .field input:not(:placeholder-shown) + label { top: 9px; font-size: 11px; letter-spacing: .03em; color: var(--text-dim); }
.field input:focus + label { color: var(--accent); }
.toggle {
  position: absolute; right: 8px; top: 27px; transform: translateY(-50%);
  width: 38px; height: 38px; border: none; background: transparent; color: var(--text-faint);
  cursor: pointer; border-radius: 9px; display: grid; place-items: center;
}
.toggle:hover, .toggle.on { color: var(--text); background: var(--field); }
.toggle svg { width: 19px; height: 19px; }

.btn {
  width: 100%; height: 50px; border: none; border-radius: var(--radius-sm); margin-top: 4px;
  font-family: inherit; font-size: 15px; font-weight: 600; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); background-size: 160% 160%;
  box-shadow: 0 10px 28px -12px var(--accent); position: relative; overflow: hidden;
  transition: background-position .4s var(--ease), transform .15s var(--ease);
}
.btn:hover { background-position: 100% 0; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.btn .label { transition: opacity .2s var(--ease); }
.btn.loading .label { opacity: 0; }
.spinner { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s var(--ease); }
.btn.loading .spinner { opacity: 1; }
.spinner i { width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Kopfzeile ---- */
.topbar {
  position: sticky; top: 0; z-index: 30; min-height: 62px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 18px;
  background: var(--surface); border-bottom: 1px solid var(--surface-border);
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.topbar .brand { padding: 2px 4px; border-radius: 10px; }
.topbar .brand:hover { background: var(--field); }
.mainnav { display: flex; gap: 4px; flex: 1 1 auto; justify-content: center; min-width: 0; overflow-x: auto; }
.mainnav-item {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 8px 14px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; color: var(--text-dim); text-decoration: none;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.mainnav-item svg { width: 16px; height: 16px; flex: none; }
.mainnav-item:hover { background: var(--field); color: var(--text); }
.mainnav-item.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.tb-right { display: flex; align-items: center; gap: 14px; }
.userinfo { display: flex; flex-direction: column; line-height: 1.25; text-align: right; }
.userinfo .user { font-size: 13px; font-weight: 600; white-space: nowrap; }
.userinfo .tag { font-size: 11px; color: var(--text-faint); letter-spacing: .03em; }
.logout {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px;
  padding: 6px 10px; border-radius: 9px; border: 1px solid var(--field-border); background: var(--field);
  color: var(--text-dim); text-decoration: none;
}
.logout svg { width: 15px; height: 15px; }
.logout:hover { color: var(--danger); border-color: var(--danger); }

.theme-switch {
  position: relative; width: 64px; height: 30px; flex: none; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--field-border); background: var(--field); color: var(--text-faint);
  display: flex; align-items: center; justify-content: space-between; padding: 0 8px;
}
.theme-switch .ico { width: 15px; height: 15px; position: relative; z-index: 1; transition: opacity .2s var(--ease); }
.theme-switch .knob {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); transition: transform .3s var(--ease);
}
:root:not([data-theme="light"]) .theme-switch .knob { transform: translateX(34px); }
:root:not([data-theme="light"]) .theme-switch .ico-moon { opacity: 0; }
:root[data-theme="light"] .theme-switch .ico-sun { opacity: 0; }

/* ---- Inhalt ---- */
.layout { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 30px 20px 48px; display: flex; flex-direction: column; gap: 28px; }
.hero h1 { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.hero .sub { color: var(--text-dim); font-size: 14px; margin-top: 4px; }
.block-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.block-title .count { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--field); border: 1px solid var(--field-border); display: inline-grid; place-items: center; font-size: 11px; color: var(--text-dim); letter-spacing: 0; }
.hint { font-size: 13px; color: var(--text-faint); }
.panel { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius); padding: 22px 24px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tile {
  display: flex; align-items: flex-start; gap: 14px; padding: 16px 16px 16px 18px; min-height: 96px;
  background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius);
  text-decoration: none; color: inherit;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
a.tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 16px 36px -22px var(--accent); }
a.tile:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.t-ico { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.t-ico svg { width: 21px; height: 21px; }
.t-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.t-label { font-size: 15px; font-weight: 600; }
.t-desc { font-size: 13px; color: var(--text-dim); line-height: 1.4; }
.t-note { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; }
.t-go { color: var(--text-faint); align-self: center; }
.t-go svg { width: 18px; height: 18px; }
a.tile:hover .t-go { color: var(--accent); }
.tile.state-soon, .tile.state-locked { opacity: .62; }
.tile.state-soon .t-ico, .tile.state-locked .t-ico { background: var(--field); color: var(--text-faint); }

.ships { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ship {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-sm);
  text-decoration: none; color: inherit; transition: border-color .2s var(--ease);
}
a.ship:hover { border-color: var(--accent); }
.s-img { width: 56px; height: 40px; flex: none; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--field); color: var(--text-faint); }
.s-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.s-img svg { width: 22px; height: 22px; }
.s-body { display: flex; flex-direction: column; min-width: 0; }
.s-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-sub { font-size: 12px; color: var(--text-faint); }

.facts { display: grid; grid-template-columns: 180px 1fr; gap: 10px 18px; font-size: 14px; margin-bottom: 18px; }
.facts dt { color: var(--text-faint); }
.plain { list-style: none; display: flex; flex-direction: column; gap: 3px; }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; }
  .mainnav { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .userinfo { display: none; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
}
@media (max-width: 440px) {
  .card { padding: 30px 22px 22px; }
  .logout span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .spinner i { animation: spin .7s linear infinite !important; }
}
