/* SucheFreunde – minimalistisch, modern */

:root {
  /* Gemeinsame Footer-Dekoration (Datei: public/assets/images/bg_footer.png) */
  --sf-bg-footer-img: url("../images/bg_footer.png");
  /* Abstand Inhalt → unterer Viewport-Rand (Footer-Grafik) */
  --sf-content-bottom-pad: 200px;
  /* Sichtbare Höhe der Footer-Deko am unteren Viewport */
  --sf-footer-deco-height: min(48vh, 480px);
  /* Abstand der Footer-Links über der Deko */
  --sf-footer-links-offset: clamp(2rem, 7vh, 4.5rem);
  --bg: #0a0a0c;
  --surface: rgba(255, 255, 255, 0.06);
  --text: #f5f5f5;
  --text-muted: rgba(255, 255, 255, 0.5);
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.25);
  --border: rgba(255, 255, 255, 0.08);
  --radius: 1rem;
}

[data-theme="light"] {
  --bg: #f8f9fc;
  --surface: rgba(0, 0, 0, 0.04);
  --text: #1a1a1e;
  --text-muted: rgba(0, 0, 0, 0.5);
  --border: rgba(0, 0, 0, 0.08);
  --accent-soft: rgba(99, 102, 241, 0.18);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
}

body {
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
}

input, select, textarea {
  font-size: 16px;
  max-width: 100%;
}

a {
  color: #4f46e5;
  text-decoration: none;
}

a:hover {
  color: #3730a3;
  text-decoration: none;
}

/* Footer-Grafik: fest unten im Viewport (nicht am Seitenende) */
body:has(> .legal)::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--sf-footer-deco-height);
  z-index: 1;
  pointer-events: none;
  background: var(--sf-bg-footer-img) center bottom / max(1920px, 100vw) auto no-repeat;
}

.legal {
  position: relative;
  z-index: 0;
  padding-bottom: calc(var(--sf-footer-deco-height) + 2rem);
}

/* ========== Index: Schrittweise helle Pastel-Gradienten ========== */
.index-page {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem var(--sf-content-bottom-pad);
  overflow-x: clip;
  /* Dunkle Schrift auf hellem Hintergrund */
  --index-text: #2d2a36;
  --index-text-muted: #5c5868;
  --index-surface: rgba(255, 255, 255, 0.7);
  --index-border: rgba(0, 0, 0, 0.08);
  --index-accent: #6366f1;
  --index-accent-soft: rgba(99, 102, 241, 0.2);
}

.sf-turnstile {
  margin: 0.85rem 0 0.2rem;
  min-height: 4.1rem;
  display: flex;
  justify-content: center;
}

.sf-turnstile[hidden] {
  display: none !important;
}

/* Footer-Grafik: fest unten, über Verlauf, unter Formular (z siehe .step-container) */
.index-page::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--sf-footer-deco-height);
  z-index: 1;
  pointer-events: none;
  background: var(--sf-bg-footer-img) center bottom / max(1920px, 100vw) auto no-repeat;
}

.gradient-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: background 0.6s ease;
}

/* Step 1: Flieder */
.index-page[data-step="1"] .gradient-bg {
  background: #e6baff;
}

/* Step 2: Frisch, kräftiger Mint/Teal */
.index-page[data-step="2"] .gradient-bg {
  background: linear-gradient(160deg, #c8efe8 0%, #9de0d4 40%, #7dd4c4 100%);
}

/* Step 3: Weich, kräftiger Lavendel */
.index-page[data-step="3"] .gradient-bg {
  background: linear-gradient(160deg, #e0d4ff 0%, #c4b0f5 40%, #a88ee8 100%);
}

/* Login (nur E-Mail): gleicher Ton wie Schritt 3 */
.index-page[data-step="login-email"] .gradient-bg {
  background: linear-gradient(160deg, #e0d4ff 0%, #c4b0f5 40%, #a88ee8 100%);
}

/* Step 4: E-Mail – Himmelblau */
.index-page[data-step="4"] .gradient-bg {
  background: linear-gradient(160deg, #c8dcff 0%, #9ec4f8 40%, #7aacf0 100%);
}

/* Step 5: Code – warmes Rosa */
.index-page[data-step="5"] .gradient-bg {
  background: linear-gradient(160deg, #ffd6e8 0%, #f5b8d4 40%, #e89ec4 100%);
}

/* ========== Onboarding Steps ========== */
.step-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 28rem;
  text-align: center;
}

.index-progress {
  margin: 0.35rem auto 0;
  padding: 0.15rem 0.1rem 0.2rem;
  text-align: left;
}

.input-wrap .index-progress {
  margin-top: 0;
  padding: 0;
}

.step .input-wrap:has(.index-progress) input {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-width: 0;
}

.step .input-wrap:has(.index-progress) .index-progress-track {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
}

.index-progress-track {
  position: relative;
  width: 100%;
  height: 1.40rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.42);
  overflow: hidden;
}

.index-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  border-bottom-right-radius: 0;
  background: linear-gradient(90deg, rgba(74, 69, 99, 0.62) 0%, rgba(106, 98, 141, 0.56) 100%);
  box-shadow: 0 0 6px rgba(64, 58, 86, 0.2);
  transition: width 260ms ease;
}

.index-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
  padding: 0.08rem 0;
  letter-spacing: 0.02em;
  color: rgba(47, 42, 58, 0.82);
  text-transform: uppercase;
  pointer-events: none;
}

.index-page[data-step="1"] .index-progress-track {
  background: rgba(255, 255, 255, 0.36);
  border-color: rgba(166, 111, 84, 0.28);
}

.index-page[data-step="1"] .index-progress-fill {
  background: linear-gradient(90deg, rgba(176, 113, 79, 0.62) 0%, rgba(199, 128, 89, 0.56) 100%);
}

.index-page[data-step="2"] .index-progress-track {
  background: rgba(255, 255, 255, 0.36);
  border-color: rgba(58, 126, 114, 0.28);
}

.index-page[data-step="2"] .index-progress-fill {
  background: linear-gradient(90deg, rgba(56, 135, 119, 0.62) 0%, rgba(75, 156, 136, 0.54) 100%);
}

.index-page[data-step="3"] .index-progress-track {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(89, 72, 155, 0.28);
}

.index-page[data-step="3"] .index-progress-fill {
  background: linear-gradient(90deg, rgba(97, 82, 166, 0.62) 0%, rgba(124, 103, 184, 0.56) 100%);
}

.step {
  display: none;
  animation: stepIn 0.5s ease-out forwards;
}

.step.active {
  display: block;
}

.step.leaving {
  animation: stepOut 0.4s ease-in forwards;
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stepOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-16px);
  }
}

.step .welcome-text {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--index-text-muted, var(--text-muted));
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
  animation: headline-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.step .typewriter-line {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 2rem;
  color: var(--index-text, var(--text));
  font-family: inherit;
  line-height: 1.25;
  min-height: 1.2em;
  opacity: 0;
  transform: translateY(0.65rem);
}

.step .typewriter-line.is-revealed {
  animation: headline-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes headline-in {
  from {
    opacity: 0;
    transform: translateY(0.65rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .step .welcome-text,
  .step .typewriter-line,
  .step .typewriter-line.is-revealed {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.step .input-wrap,
.step .btn,
.step .hint,
.step .index-progress {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.step .input-wrap.visible,
.step .btn.visible,
.step .hint.visible,
.step .index-progress.visible {
  pointer-events: auto;
}

.step .input-wrap.visible,
.step .btn.visible,
.step .hint.visible,
.step .index-progress.visible {
  opacity: 1;
  transform: translateY(0);
}

.step .input-wrap {
  margin-bottom: 1.5rem;
}

.step input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 1.25rem 1.5rem;
  font-size: 1.25rem;
  font-family: inherit;
  color: var(--index-text, var(--text));
  background: var(--index-surface, var(--surface));
  border: 1px solid var(--index-border, var(--border));
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.step input::placeholder {
  color: var(--index-text-muted, var(--text-muted));
}

.step input:focus {
  border-color: var(--index-accent, var(--accent));
  box-shadow: 0 0 0 3px var(--index-accent-soft, var(--accent-soft));
}

.step .btn {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  color: #fff;
  background: var(--index-accent, var(--accent));
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.step .btn:hover {
  opacity: 0.95;
}

.step .btn:active {
  transform: scale(0.98);
}

.step .hint {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--index-text-muted, var(--text-muted));
}

.step .hint.index-lead {
  margin-top: 0;
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--index-text, var(--text));
}

/* Onboarding: fünf Code-Ziffern */
.code-inputs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0;
}

.code-input {
  width: 2.75rem;
  height: 3rem;
  padding: 0;
  font-size: 1.5rem;
  font-family: inherit;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  color: var(--index-text, var(--text));
  background: var(--index-surface, var(--surface));
  border: 2px solid var(--index-border, var(--border));
  border-radius: 0.5rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.code-input:focus {
  border-color: var(--index-accent, var(--accent));
  box-shadow: 0 0 0 3px var(--index-accent-soft, var(--accent-soft));
}

.code-inputs-wrap.checking .code-inputs {
  opacity: 0.4;
  pointer-events: none;
}

.code-checking {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--index-text-muted, var(--text-muted));
}

.code-inputs-wrap.checking .code-checking {
  display: flex;
  animation: codeFadeIn 0.3s ease;
}

.code-checking-spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--index-border, var(--border));
  border-top-color: var(--index-accent, var(--accent));
  border-radius: 50%;
  animation: codeSpin 0.7s linear infinite;
}

@keyframes codeSpin {
  to { transform: rotate(360deg); }
}

@keyframes codeFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.code-error {
  display: none;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #c53030;
  text-align: center;
  animation: codeShake 0.5s ease;
}

.code-inputs-wrap.error .code-error {
  display: block;
}

.code-inputs-wrap.error .code-input {
  border-color: #c53030;
  animation: codeShake 0.5s ease;
}

@keyframes codeShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ========== Footer Index ========== */
.index-footer {
  position: relative;
  z-index: 3;
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem 1rem calc(var(--sf-footer-links-offset) + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.index-footer a {
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--index-text-muted, var(--text-muted));
  text-decoration: none;
  margin: 0 0.5rem;
}

.index-footer a:hover {
  color: var(--index-text, var(--text));
}

.index-footer span {
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--index-text-muted, var(--text-muted));
}

.dashboard-footer {
  position: relative;
  z-index: 3;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.9rem 1rem calc(var(--sf-footer-links-offset) + 1.1rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.dashboard-footer span {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dashboard-footer .dashboard-footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.dashboard-footer .dashboard-footer-legal a {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.dashboard-footer .dashboard-footer-legal a:hover {
  text-decoration: underline;
}

/* ========== Dashboard: Dark = Tokens, Light = Pastell (nur data-theme=light) ========== */
.dashboard-page {
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  background-color: #12121a;
  background-image: linear-gradient(165deg, #12121a 0%, #0c0c10 40%, #10141c 100%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: relative;
}

.dashboard-page::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--sf-footer-deco-height);
  z-index: 0;
  pointer-events: none;
  background: var(--sf-bg-footer-img) center bottom / max(1920px, 100vw) auto no-repeat;
}

.dashboard-page > * {
  position: relative;
  z-index: 1;
}

html[data-theme="light"] .dashboard-page {
  background-color: #e8e4f5;
  background-image: linear-gradient(165deg, #e0d8f8 0%, #d0c4f0 30%, #b8d4e8 60%, #c8dce8 100%);
  color: #2d2a36;
}

/* Profil bearbeiten (ohne .dashboard-page): gleiche Footer-Deko */
.profil-page:not(.dashboard-page)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--sf-footer-deco-height);
  z-index: 0;
  pointer-events: none;
  background: var(--sf-bg-footer-img) center bottom / max(1920px, 100vw) auto no-repeat;
}

.profil-page:not(.dashboard-page) > * {
  position: relative;
  z-index: 1;
}

.dashboard-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(10, 10, 12, 0.8);
  backdrop-filter: blur(12px);
}

.dashboard-page .dashboard-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  width: 100%;
  background: rgba(18, 18, 26, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .dashboard-header {
  background: rgba(248, 249, 252, 0.9);
}

html[data-theme="light"] .dashboard-page .dashboard-header {
  background: rgba(232, 228, 245, 0.92);
  border-bottom-color: rgba(99, 102, 241, 0.18);
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.dashboard-page .logo {
  color: var(--text);
}

html[data-theme="light"] .dashboard-page .logo {
  color: #2d2a36;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Nur Top-Bar-Icons / Profil-Kreis – nicht Links & Buttons in Dropdown-Panels */
.header-actions > .header-dropdown-wrap > a.header-icon-btn,
.header-actions > .profile-wrap > button.profile-btn,
.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.dashboard-page .header-icon-btn,
.dashboard-page .header-actions > .header-dropdown-wrap > a.header-icon-btn {
  color: var(--text-muted);
}

.dashboard-page .header-icon-btn:hover,
.dashboard-page .header-actions > .header-dropdown-wrap > a.header-icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .dashboard-page .header-icon-btn,
html[data-theme="light"] .dashboard-page .header-actions > .header-dropdown-wrap > a.header-icon-btn {
  color: #4a4656;
}

html[data-theme="light"] .dashboard-page .header-icon-btn:hover,
html[data-theme="light"] .dashboard-page .header-actions > .header-dropdown-wrap > a.header-icon-btn:hover {
  color: #2d2a36;
  background: rgba(255, 255, 255, 0.4);
}

.header-actions > .header-dropdown-wrap > a.header-icon-btn:hover,
.header-actions > .profile-wrap > button.profile-btn:hover,
.header-icon-btn:hover {
  color: var(--text);
  background: var(--surface);
}

.header-dropdown-wrap {
  position: relative;
}

.header-panel {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  margin-top: 0.25rem;
  width: min(20rem, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  max-height: 18rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 101;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.dashboard-page .header-panel {
  background: rgba(22, 22, 30, 0.96);
  border-color: var(--border);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}

.dashboard-page .header-panel-title {
  color: var(--text-muted);
  border-bottom-color: var(--border);
}

.dashboard-page .header-panel-item {
  color: var(--text);
}

.dashboard-page .header-panel-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] .dashboard-page .header-panel {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .dashboard-page .header-panel-title {
  color: #5c5868;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .dashboard-page .header-panel-item {
  color: #2d2a36;
}

html[data-theme="light"] .dashboard-page .header-panel-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.header-dropdown-wrap.is-open .header-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .dashboard-header .header-dropdown-wrap .header-panel {
    position: fixed;
    top: calc(3.85rem + env(safe-area-inset-top, 0px));
    left: max(0.65rem, env(safe-area-inset-left, 0px));
    right: max(0.65rem, env(safe-area-inset-right, 0px));
    width: auto;
    max-width: none;
    margin-top: 0;
    max-height: min(70vh, 22rem);
  }
  .dashboard-header .header-dropdown-wrap.is-open .header-panel {
    transform: none;
  }
}

.header-panel-title {
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.header-panel-list {
  overflow-y: auto;
  max-height: 16rem;
  padding: 0.25rem 0;
}

.header-panel-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.4;
  transition: background 0.15s;
}

.header-panel-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .header-panel-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.header-panel-item-from {
  font-weight: 600;
  margin-right: 0.35rem;
}

.profile-wrap {
  position: relative;
}

.profile-btn {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-btn .avatar-placeholder {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  border-radius: 50%;
  font-size: 0.9rem;
}

.profile-btn .header-user-avatar {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.dashboard-page .profile-btn {
  border-color: var(--border);
}

html[data-theme="light"] .dashboard-page .profile-btn {
  border-color: rgba(0, 0, 0, 0.12);
}

.profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  min-width: 12rem;
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 101;
}

.profile-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dashboard-page .profile-dropdown {
  background: rgba(22, 22, 30, 0.98);
  border-color: var(--border);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

.dashboard-page .profile-dropdown a,
.dashboard-page .profile-dropdown button {
  color: var(--text);
}

.dashboard-page .profile-dropdown a:hover,
.dashboard-page .profile-dropdown button:hover {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .dashboard-page .profile-dropdown {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .dashboard-page .profile-dropdown a,
html[data-theme="light"] .dashboard-page .profile-dropdown button {
  color: #2d2a36;
}

html[data-theme="light"] .dashboard-page .profile-dropdown a:hover,
html[data-theme="light"] .dashboard-page .profile-dropdown button:hover {
  background: rgba(0, 0, 0, 0.06);
}

.profile-logout-form {
  margin: 0;
  width: 100%;
}

.profile-dropdown a,
.profile-dropdown button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: none;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.theme-toggle {
  justify-content: space-between;
  gap: 0.5rem;
}

.theme-toggle-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.theme-toggle-track {
  position: relative;
  width: 2.3rem;
  height: 1.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.theme-toggle-thumb {
  position: absolute;
  top: 50%;
  left: 1.18rem;
  width: 0.86rem;
  height: 0.86rem;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
  transition: left 0.2s ease;
}

.theme-toggle[data-theme="light"] .theme-toggle-track {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.45);
}

.theme-toggle[data-theme="light"] .theme-toggle-thumb {
  left: 0.14rem;
}

.profile-dropdown a:hover,
.profile-dropdown button:hover {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .profile-dropdown a:hover,
[data-theme="light"] .profile-dropdown button:hover {
  background: rgba(0, 0, 0, 0.06);
}

.dashboard-main {
  flex: 1;
  padding: 2rem 1.5rem var(--sf-content-bottom-pad);
  max-width: 36rem;
  margin: 0 auto;
  width: 100%;
}

/* Freunde, Nachrichten u. a.: gleiche Breite wie breitere Listen */
.dashboard-main.app-list-page-main {
  max-width: min(52rem, 100%);
}

.dashboard-main h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  text-align: center;
}

.dashboard-page .dashboard-main h1 {
  color: var(--text);
}

html[data-theme="light"] .dashboard-page .dashboard-main h1 {
  color: #2d2a36;
}

.search-wrap {
  margin-bottom: 2rem;
}

.search-wrap input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dashboard-page .search-wrap input {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.dashboard-page .search-wrap input::placeholder {
  color: var(--text-muted);
}

html[data-theme="light"] .dashboard-page .search-wrap input {
  color: #2d2a36;
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .dashboard-page .search-wrap input::placeholder {
  color: #5c5868;
}

.search-wrap input::placeholder {
  color: var(--text-muted);
}

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.section-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.dashboard-page .section-label {
  color: var(--text-muted);
}

html[data-theme="light"] .dashboard-page .section-label {
  color: #4a4656;
}

.dashboard-page .hint {
  color: var(--text-muted);
  text-align: center;
}

.dashboard-empty-city {
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.45;
  text-align: left;
}

.dashboard-empty-city a {
  color: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.dashboard-empty-city-actions {
  list-style: disc;
  margin: 0 0 0 1.15rem;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.dashboard-empty-city-note {
  font-size: 0.88rem;
}

html[data-theme="light"] .dashboard-empty-city-actions {
  color: #4a4656;
}

html[data-theme="light"] .dashboard-page .hint {
  color: #4a4656;
}

.suggestions-list {
  list-style: none;
}

.suggestion-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  transition: border-color 0.2s, background 0.2s;
}

.dashboard-page .suggestion-card {
  border-color: var(--border);
}

.dashboard-page .suggestion-card:not(.sf-user-highlight) {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .dashboard-page .suggestion-card {
  border-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .dashboard-page .suggestion-card:not(.sf-user-highlight) {
  background: #fff;
}

.suggestion-card:not(.sf-user-highlight):hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.08);
}

.dashboard-page .suggestion-card:not(.sf-user-highlight):hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .dashboard-page .suggestion-card:not(.sf-user-highlight):hover {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
}

.suggestion-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--border);
}

.suggestion-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.95rem;
  row-gap: 0.22rem;
  width: 100%;
  min-width: 0;
}

.suggestion-info > .suggestion-name {
  order: 1;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.suggestion-info > .suggestion-looking-icons {
  order: 2;
  flex: 0 0 auto;
  margin-top: 0;
}

.suggestion-info > .suggestion-place,
.suggestion-info > .suggestion-meta {
  order: 3;
  flex: 1 0 100%;
  min-width: 0;
}

.suggestion-info > .suggestion-interests {
  order: 4;
  flex: 1 0 100%;
  min-width: 0;
}

.suggestion-name {
  display: block;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.dashboard-page .suggestion-name {
  color: var(--text);
}

html[data-theme="light"] .dashboard-page .suggestion-name {
  color: #2d2a36;
}

.suggestion-meta {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.dashboard-page .suggestion-meta {
  color: var(--text-muted);
  opacity: 0.92;
}

html[data-theme="light"] .dashboard-page .suggestion-meta {
  color: #5c5868;
  opacity: 1;
}

.suggestion-place {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.015em;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.dashboard-page .suggestion-place {
  color: rgba(255, 255, 255, 0.62);
}

html[data-theme="light"] .dashboard-page .suggestion-place {
  color: #5b5670;
}

.suggestion-interests {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-muted);
  opacity: 0.88;
  overflow-wrap: anywhere;
}

.dashboard-page .suggestion-interests {
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="light"] .dashboard-page .suggestion-interests {
  color: #6b6578;
  opacity: 1;
}

.suggestion-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 100%;
}

.suggestion-actions button {
  padding: 0 0.75rem;
  min-height: 2.2rem;
  height: 2.2rem;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 650;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.dashboard-page .suggestion-actions button:not(.primary) {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] .dashboard-page .suggestion-actions button:not(.primary) {
  color: #2d2a36;
  border-color: rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.5);
}

.suggestion-actions button:hover {
  border-color: var(--border);
  background: transparent;
}

.dashboard-page .suggestion-actions button:not(.primary):hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

html[data-theme="light"] .dashboard-page .suggestion-actions button:not(.primary):hover {
  background: rgba(255, 255, 255, 0.5);
  color: #2d2a36;
}

.suggestion-actions button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.suggestion-actions button.primary:hover {
  opacity: 0.95;
}

/* Placeholder avatars */
.avatar-placeholder {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
}

.avatar-placeholder--female {
  background: #f472b6;
}

.avatar-placeholder--male {
  background: #60a5fa;
}

.avatar-placeholder--neutral {
  background: #94a3b8;
}

.avatar-placeholder-icon {
  display: block;
  width: 56%;
  height: 56%;
  flex-shrink: 0;
}
