/* ══════════════════════════════════════════════
   PORTAPLIX – Vermittlungsplattform
   Dark-first design, Orange accent
   ══════════════════════════════════════════════ */

:root {
  --accent: #F37021;
  --accent-glow: #FF8C42;
  --accent-dim: rgba(243,112,33,0.12);
  --accent-border: rgba(243,112,33,0.25);

  --bg: #06060B;
  --bg-card: #0E0E18;
  --bg-input: #13131F;
  --bg-elevated: #181828;
  --bg-hover: #1C1C2E;

  --border: #1E1E32;
  --border-focus: #2A2A44;

  --text: #F0F0F5;
  --text-sub: #7A7A9E;
  --text-dim: #4A4A6A;

  --success: #22C55E;
  --error: #EF4444;
  --warning: #F59E0B;
  --info: #3B82F6;

  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 100px;

  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', monospace;

  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.6);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }
input, textarea, select, button { font: inherit; }

/* ── Noise overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ── App container ── */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  #app { max-width: 520px; }
}

/* ── Page transitions ── */
.page { 
  flex: 1; 
  padding: 20px; 
  padding-bottom: 100px;
  animation: pageIn 0.3s ease;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════
   TYPOGRAPHY
   ══════════════════════════════════════════════ */
.t-hero {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.t-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.t-subtitle {
  font-size: 1rem;
  font-weight: 600;
}
.t-body { font-size: 0.95rem; color: var(--text-sub); }
.t-small { font-size: 0.82rem; color: var(--text-dim); }
.t-mono { font-family: var(--font-mono); }
.t-accent { color: var(--accent); }
.t-center { text-align: center; }

/* ══════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  position: relative;
  overflow: hidden;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:not(:disabled):hover {
  background: var(--accent-glow);
  box-shadow: 0 0 30px rgba(243,112,33,0.3);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--accent-border);
  background: var(--accent-dim);
}
.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  padding: 10px 16px;
}
.btn-ghost:hover { color: var(--accent); }
.btn-sm {
  padding: 10px 18px;
  font-size: 0.85rem;
}
.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover {
  background: rgba(239,68,68,0.1);
}

/* Loading spinner in button */
.btn .spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════
   INPUTS
   ══════════════════════════════════════════════ */
.input-group {
  margin-bottom: 16px;
}
.input-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.input {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  transition: all var(--transition);
  outline: none;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.input::placeholder { color: var(--text-dim); }

textarea.input {
  resize: vertical;
  min-height: 80px;
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237A7A9E'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ══════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
}
.card-interactive {
  cursor: pointer;
}
.card-interactive:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }

/* ══════════════════════════════════════════════
   VERMITTLER BADGE
   ══════════════════════════════════════════════ */
.badge-vermittler {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--accent);
  line-height: 1.4;
}
.badge-vermittler-compact {
  display: inline-flex;
  padding: 4px 10px;
  background: var(--accent-dim);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
}

/* ══════════════════════════════════════════════
   STATUS PILLS
   ══════════════════════════════════════════════ */
.pill {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}
.pill-active { background: rgba(34,197,94,0.15); color: var(--success); }
.pill-pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.pill-matched { background: rgba(59,130,246,0.15); color: var(--info); }
.pill-error { background: rgba(239,68,68,0.15); color: var(--error); }
.pill-grey { background: rgba(122,122,158,0.15); color: var(--text-sub); }

/* ══════════════════════════════════════════════
   BOTTOM NAVIGATION
   ══════════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 6px 0;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(14,14,24,0.92);
}
@media (min-width: 768px) {
  .bottom-nav { max-width: 520px; }
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0;
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition);
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}
.nav-item:hover,
.nav-item.active {
  color: var(--accent);
}
.nav-item svg {
  width: 22px; height: 22px;
  stroke-width: 1.8;
}
.nav-item.active svg { stroke-width: 2.2; }
.nav-badge {
  position: absolute;
  top: 2px; right: calc(50% - 16px);
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

/* ══════════════════════════════════════════════
   PROGRESS BAR
   ══════════════════════════════════════════════ */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 24px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ══════════════════════════════════════════════
   SLIDER
   ══════════════════════════════════════════════ */
.slider-container { margin: 20px 0; }
.slider-value {
  font-size: 2.4rem;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  letter-spacing: -0.03em;
}
input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  margin: 16px 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(243,112,33,0.4);
}

/* ══════════════════════════════════════════════
   CHECKBOX
   ══════════════════════════════════════════════ */
.checkbox-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.checkbox-row input[type="checkbox"] {
  width: 20px; height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.checkbox-row span { font-size: 0.85rem; color: var(--text-sub); line-height: 1.5; }

/* ══════════════════════════════════════════════
   CHAT
   ══════════════════════════════════════════════ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 60px);
}
.chat-header {
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-hint {
  padding: 6px 16px;
  background: var(--accent-dim);
  font-size: 0.72rem;
  color: var(--accent);
  text-align: center;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg {
  max-width: 78%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: msgIn 0.2s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
}
.msg-me {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-other {
  align-self: flex-start;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg-system {
  align-self: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  background: none;
  padding: 4px 12px;
}
.chat-input-bar {
  padding: 12px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.chat-input-bar input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  outline: none;
}
.chat-input-bar input:focus {
  border-color: var(--accent);
}
.chat-send-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.chat-send-btn:hover {
  background: var(--accent-glow);
  box-shadow: 0 0 20px rgba(243,112,33,0.3);
}
.chat-send-btn svg { width: 20px; height: 20px; fill: #fff; }

/* ══════════════════════════════════════════════
   AVATAR
   ══════════════════════════════════════════════ */
.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.avatar-lg { width: 72px; height: 72px; font-size: 1.8rem; }

/* ══════════════════════════════════════════════
   PROFILE STAT ROW
   ══════════════════════════════════════════════ */
.stat-row {
  display: flex;
  gap: 12px;
}
.stat-item {
  flex: 1;
  text-align: center;
  padding: 16px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ══════════════════════════════════════════════
   DIVIDER
   ══════════════════════════════════════════════ */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.divider span { font-size: 0.8rem; color: var(--text-dim); }

/* ══════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}
.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

/* ══════════════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════════════ */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 20px;
}
.topbar-back {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  transition: all var(--transition);
}
.topbar-back:hover { border-color: var(--accent-border); }

/* ══════════════════════════════════════════════
   LOADING
   ══════════════════════════════════════════════ */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
}
.loader {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ══════════════════════════════════════════════
   LIST ITEMS
   ══════════════════════════════════════════════ */
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.list-item:hover { background: var(--bg-hover); }
.list-item-content { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; font-size: 0.92rem; }
.list-item-sub {
  font-size: 0.82rem;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-meta {
  text-align: right;
  flex-shrink: 0;
}
.unread-dot {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: auto;
}

/* ══════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════ */
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.opacity-50 { opacity: 0.5; }

/* ══════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast-success { border-color: rgba(34,197,94,0.4); color: var(--success); }
.toast-error { border-color: rgba(239,68,68,0.4); color: var(--error); }

/* ══════════════════════════════════════════════
   LANDING PAGE
   ══════════════════════════════════════════════ */
.landing-hero {
  position: relative;
  padding: 48px 0 40px;
  text-align: center;
}
.landing-hero-glow {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(243,112,33,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.landing-h1 {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text) 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-sub {
  font-size: 1rem;
  color: var(--text-sub);
  line-height: 1.6;
  max-width: 340px;
  margin: 0 auto 28px;
}
.landing-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 300px;
  margin: 0 auto;
}

/* Steps */
.steps-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.step-card {
  position: relative;
  padding: 20px 20px 20px 68px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}
.step-card:hover { border-color: var(--accent-border); }
.step-num {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 36px;
  height: 36px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}
.step-icon {
  font-size: 1.3rem;
  margin-bottom: 4px;
}
.step-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.step-desc {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.5;
}

/* Trust */
.trust-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.trust-item span:first-child {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.trust-item strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Final CTA */
.landing-final-cta {
  text-align: center;
  padding: 36px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

/* ══════════════════════════════════════════════
   TABS (Listings)
   ══════════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.tab {
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* ══════════════════════════════════════════════
   DETAIL ROWS (Listing Detail)
   ══════════════════════════════════════════════ */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 500;
}
.detail-value {
  font-size: 0.92rem;
  color: var(--text);
  text-align: right;
  max-width: 60%;
}
.mt-4 { margin-top: 4px; }
.mb-4 { margin-bottom: 4px; }
