@import url("tokens.css");

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ly-color-bg);
  color: var(--ly-color-body);
  font-family: var(--ly-font-sans);
  font-size: 16px;
  line-height: 1.6;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(200,164,93,.72);
  outline-offset: 3px;
}

.ly-container {
  width: min(var(--ly-container), calc(100% - 40px));
  margin-inline: auto;
}

.ly-section {
  padding: 72px 0;
}

.ly-section-sm {
  padding: 48px 0;
}

.ly-eyebrow {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--ly-color-primary-hover);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ly-color-text);
  line-height: 1.08;
  letter-spacing: -.035em;
  /* Deutsche Komposita sind laenger als die Mindestgroesse der Ueberschrift:
     "Allgemeine Geschaeftsbedingungen" braucht bei 42 px rund 516 px und
     sprengte auf 390-px-Geraeten die Seitenbreite. Getrennt wird bevorzugt an
     den Silben (html[lang=de]); nur wenn das nicht reicht, wird hart
     umbrochen. */
  overflow-wrap: break-word;
  hyphens: auto;
}

h1 {
  font-size: clamp(42px, 7vw, 78px);
  font-weight: 850;
}

h2 {
  font-size: clamp(32px, 4.6vw, 54px);
  font-weight: 820;
}

h3 {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 780;
}

p {
  margin: 0;
}

.ly-lead {
  margin-top: 22px;
  max-width: 720px;
  color: var(--ly-color-muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.65;
}

.ly-card {
  background: var(--ly-color-card);
  border: 1px solid var(--ly-color-border);
  border-radius: var(--ly-radius-lg);
  box-shadow: var(--ly-shadow-md);
}

.ly-card-pad {
  padding: clamp(22px, 4vw, 36px);
}

.ly-grid {
  display: grid;
  gap: 24px;
}

.ly-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ly-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ly-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ly-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 20px;
  border: 1px solid transparent;
  border-radius: var(--ly-radius-md);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

/* Author display rules override the UA [hidden] stylesheet; keep hidden
   controls (e.g. Profil before login) truly invisible. */
.ly-btn[hidden] {
  display: none !important;
}

.ly-btn:hover {
  transform: translateY(-1px);
}

.ly-btn-primary {
  background: var(--ly-color-primary);
  color: #111827;
  box-shadow: 0 12px 30px rgba(200,164,93,.24);
}

.ly-btn-primary:hover {
  background: var(--ly-color-primary-hover);
}

.ly-btn-secondary {
  background: #FFFFFF;
  color: var(--ly-color-text);
  border-color: var(--ly-color-border);
  box-shadow: var(--ly-shadow-sm);
}

.ly-btn-ghost {
  background: transparent;
  color: var(--ly-color-text);
}

.ly-btn-lg {
  min-height: 56px;
  padding: 16px 24px;
  border-radius: 16px;
  font-size: 17px;
}

.ly-input,
.ly-select,
.ly-textarea {
  width: 100%;
  border: 1px solid var(--ly-color-border);
  border-radius: var(--ly-radius-md);
  background: #FFFFFF;
  color: var(--ly-color-text);
  font: inherit;
  padding: 14px 16px;
  outline: none;
}

.ly-input:focus,
.ly-select:focus,
.ly-textarea:focus {
  border-color: var(--ly-color-primary);
  box-shadow: 0 0 0 4px rgba(200,164,93,.16);
}

.ly-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--ly-radius-pill);
  padding: 7px 11px;
  background: #F3F4F6;
  color: var(--ly-color-body);
  font-size: 13px;
  font-weight: 800;
}

.ly-badge-primary {
  background: rgba(200,164,93,.16);
  color: #7A5B1E;
}

.ly-shell-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(247,248,250,.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(229,232,238,.75);
}

.ly-shell-header-inner {
  height: var(--ly-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.ly-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ly-color-text);
  text-decoration: none;
  font-weight: 900;
}

.ly-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #F3D98B, var(--ly-color-primary));
  color: #15171B;
  box-shadow: 0 10px 24px rgba(200,164,93,.25);
}

.ly-brand-mark-img {
  width: 42px;
  height: 42px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.ly-brand-studio .ly-brand-text {
  gap: 1px;
}

.ly-brand-studio .ly-brand-text strong {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #15171B;
}

.ly-brand-studio .ly-brand-text small {
  color: #15171B;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ly-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.ly-brand-text small {
  color: var(--ly-color-muted);
  font-size: 12px;
  font-weight: 700;
}

.ly-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.ly-nav a {
  color: var(--ly-color-body);
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
}

.ly-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Phase 14.7 · App-Header (Suche/Konto/Upgrade) — nur auf /app/-Seiten für
   eingeloggte Nutzer eingeblendet (app-shell-header.js). Auf Marketingseiten
   bleibt der Header unverändert, da dieselbe Komponente überall geladen wird.
   display:flex must not override the HTML hidden attribute, otherwise Suche/
   Upgrade bleed into login/register/start and overlap Anmelden/Profil/CTA. */
.ly-header-appbar {
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.ly-header-appbar:not([hidden]) {
  display: flex;
}

.ly-header-appbar[hidden] {
  display: none !important;
}

.ly-shell-header-inner:has(.ly-header-appbar:not([hidden])) .ly-nav,
.ly-shell-header-inner:has(.ly-header-appbar:not([hidden])) .ly-header-actions,
/* Der Menü-Umschalter gehört zur Marketing-Navigation; ist der App-Header
   aktiv, ist diese Navigation ausgeblendet und der Umschalter damit ohne
   Funktion — er würde sonst ein leeres Menü öffnen. */
.ly-shell-header-inner:has(.ly-header-appbar:not([hidden])) .ly-mobile-menu-button {
  display: none;
}

.ly-header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 520px;
  padding: 0 16px;
  height: 44px;
  border: 1px solid var(--ly-color-border);
  border-radius: var(--ly-radius-pill);
  background: #FFFFFF;
  color: var(--ly-color-muted);
}

.ly-header-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  color: var(--ly-color-text);
}

.ly-header-upgrade {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 18px;
  white-space: nowrap;
}

.ly-header-account {
  position: relative;
  flex: 0 0 auto;
}

.ly-header-account-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid transparent;
  border-radius: var(--ly-radius-pill);
  background: transparent;
  font: inherit;
  font-weight: 750;
  color: var(--ly-color-text);
  cursor: pointer;
}

.ly-header-account-button:hover {
  border-color: var(--ly-color-border);
}

.ly-header-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(21, 23, 27, 0.14);
  background: linear-gradient(135deg, #F3D98B, var(--ly-color-primary));
  color: #15171B;
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  flex: 0 0 auto;
}

.ly-header-avatar.has-img {
  background: #F3F4F6;
}

.ly-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ly-header-avatar .ly-header-profile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #374151;
}

.ly-header-account-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ly-header-account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  min-width: 200px;
  padding: 8px;
  border: 1px solid var(--ly-color-border);
  border-radius: var(--ly-radius-md);
  background: #FFFFFF;
  box-shadow: var(--ly-shadow-md);
  z-index: 20;
}

.ly-header-account-menu[hidden] {
  display: none;
}

.ly-header-account-menu a,
.ly-header-account-menu button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--ly-radius-sm);
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
  color: var(--ly-color-text);
  text-decoration: none;
  cursor: pointer;
}

.ly-header-account-menu a:hover,
.ly-header-account-menu button:hover {
  background: #F3F4F6;
}

@media (max-width: 860px) {
  .ly-header-search {
    display: none;
  }
}

/* Sehr schmale Geräte: Kontoname weicht dem Avatar, damit Logo, Upgrade und
   Konto nebeneinander passen und der Header nicht überläuft. */
@media (max-width: 560px) {
  .ly-header-account-name,
  .ly-header-account-button .ly-language-caret {
    display: none;
  }

  .ly-header-appbar {
    gap: 8px;
    justify-content: flex-end;
  }

  .ly-header-upgrade {
    padding: 0 12px;
  }
}

.ly-shell-footer {
  margin-top: 96px;
  padding: 56px 0 30px;
  background: #20242A;
  color: #D5DAE3;
}

.ly-shell-footer a {
  color: #D5DAE3;
  text-decoration: none;
}

.ly-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
}

.ly-footer-title {
  margin-bottom: 14px;
  color: #FFFFFF;
  font-weight: 850;
}

.ly-footer-list {
  display: grid;
  gap: 10px;
}

.ly-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.ly-social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(200,164,93,.42);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.ly-social-links a:hover {
  border-color: #C8A45D;
  background: rgba(200,164,93,.14);
  transform: translateY(-1px);
}

.ly-social-links a:focus-visible {
  outline: 3px solid #FFB500;
  outline-offset: 3px;
}

.ly-social-links img {
  display: block;
  width: 24px;
  height: 24px;
}

.ly-footer-bottom {
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #AAB2C0;
  font-size: 14px;
}

@media (max-width: 1100px) {
  .ly-nav {
    display: none;
  }

  .ly-grid-2,
  .ly-grid-3,
  .ly-grid-4,
  .ly-footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Phase 6A · Final Language Switcher */
.ly-language {
  position: relative;
  flex: 0 0 auto;
}

.ly-language-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--ly-color-border);
  border-radius: 14px;
  background: #FFFFFF;
  color: var(--ly-color-text);
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: var(--ly-shadow-sm);
}

.ly-language-caret {
  color: var(--ly-color-muted);
  font-size: 11px;
  transform: translateY(-1px);
}

.ly-language-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 2000;
  min-width: 92px;
  padding: 7px;
  border: 1px solid var(--ly-color-border);
  border-radius: 14px;
  background: #FFFFFF;
  box-shadow: var(--ly-shadow-lg);
}

.ly-language-menu[hidden] {
  display: none !important;
}

.ly-language-menu button {
  width: 100%;
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ly-color-body);
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  text-align: left;
  padding: 9px 10px;
  cursor: pointer;
}

.ly-language-menu button:hover,
.ly-language-menu button.is-active {
  background: rgba(200,164,93,.14);
  color: var(--ly-color-text);
}

.ly-language-menu [data-check] {
  color: var(--ly-color-primary-hover);
  font-weight: 900;
}

@media (max-width: 720px) {
  .ly-shell-header-inner {
    gap: 12px;
  }

  .ly-header-actions {
    gap: 8px;
  }

  .ly-language-button {
    min-height: 42px;
    padding: 9px 11px;
  }
}

/* === Phase 8 · Lyruma UI Framework === */

.ly-stack {
  display: grid;
  gap: 24px;
}

.ly-stack-sm {
  display: grid;
  gap: 14px;
}

.ly-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.ly-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.ly-panel {
  background: var(--ly-color-card);
  border: 1px solid var(--ly-color-border);
  border-radius: var(--ly-radius-xl);
  box-shadow: var(--ly-shadow-md);
  padding: clamp(24px, 4vw, 44px);
}

.ly-soft-panel {
  background: linear-gradient(180deg, #FFFFFF, #FAFAFB);
  border: 1px solid var(--ly-color-border);
  border-radius: var(--ly-radius-xl);
  box-shadow: var(--ly-shadow-sm);
  padding: clamp(22px, 3vw, 34px);
}

.ly-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border: 1px solid rgba(200,164,93,.35);
  background: rgba(200,164,93,.12);
  color: #7A5B1E;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 850;
}

.ly-divider {
  height: 1px;
  background: var(--ly-color-border);
  margin: 28px 0;
}

.ly-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--ly-radius-lg);
  background: #FFFFFF;
  box-shadow: var(--ly-shadow-sm);
}

.ly-table th,
.ly-table td {
  padding: 16px;
  border-bottom: 1px solid var(--ly-color-border);
  text-align: left;
}

.ly-table th {
  color: var(--ly-color-text);
  background: #F3F4F6;
  font-weight: 850;
}

.ly-alert {
  border-radius: var(--ly-radius-lg);
  border: 1px solid var(--ly-color-border);
  background: #FFFFFF;
  padding: 18px 20px;
  box-shadow: var(--ly-shadow-sm);
}

.ly-alert-success {
  border-color: rgba(46,157,97,.25);
  background: rgba(46,157,97,.08);
}

.ly-alert-warning {
  border-color: rgba(216,138,0,.25);
  background: rgba(216,138,0,.08);
}

.ly-form-grid {
  display: grid;
  gap: 16px;
}

.ly-form-row {
  display: grid;
  gap: 8px;
}

.ly-label {
  color: var(--ly-color-text);
  font-weight: 850;
}

.ly-helper {
  color: var(--ly-color-muted);
  font-size: 14px;
}

.ly-mobile-menu-button {
  display: none;
}

@media (max-width: 920px) {
  .ly-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .ly-mobile-menu-button {
    display: inline-flex;
  }
}

/* Phase 8 · Mobile Navigation */
@media (max-width: 992px) {
  .ly-mobile-menu-button {
    display: inline-flex;
  }

  .ly-nav[data-mobile-nav] {
    display: none;
    position: absolute;
    left: 20px;
    right: 20px;
    top: calc(100% + 10px);
    padding: 14px;
    border: 1px solid var(--ly-color-border);
    border-radius: 18px;
    background: #FFFFFF;
    box-shadow: var(--ly-shadow-lg);
  }

  .ly-nav[data-mobile-nav].is-open {
    display: grid;
    gap: 8px;
  }

  .ly-nav[data-mobile-nav] a {
    padding: 12px 14px;
    border-radius: 12px;
  }

  .ly-nav[data-mobile-nav] a:hover {
    background: #F3F4F6;
  }

  .ly-shell-header {
    position: sticky;
  }

  .ly-shell-header-inner {
    position: relative;
  }
}

@media (max-width: 560px) {
  .ly-brand-text small {
    display: none;
  }

  .ly-header-actions .ly-btn-primary,
  .ly-header-actions .ly-btn-secondary {
    display: none;
  }
}

/* Mobile drawer hotfix — portal siblings outside header (backdrop-filter trap fix) */
.ly-mobile-nav-layer {
  position: relative;
  z-index: auto;
}

.ly-header-context {
  display: none;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--ly-color-text, #101828);
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ly-mobile-nav-backdrop,
.ly-mobile-drawer {
  display: none;
}

.ly-mobile-menu-button {
  align-items: center;
  gap: 8px;
}

.ly-mobile-menu-button svg {
  display: block;
  flex: 0 0 auto;
}

@media (max-width: 992px) {
  .ly-shell-header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
  }

  .ly-header-context:not([hidden]) {
    display: block;
    justify-self: center;
  }

  .ly-header-actions {
    justify-self: end;
  }

  .ly-mobile-menu-button {
    display: inline-flex !important;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 14px;
    border: 1px solid var(--ly-color-border, rgba(16,24,40,.14));
    background: #fff;
    color: var(--ly-color-text, #101828);
  }

  .ly-mobile-menu-label {
    display: none;
  }

  .ly-nav[data-mobile-nav]:not(.ly-mobile-drawer) {
    display: none !important;
  }

  /* Backdrop sits above page, below drawer */
  .ly-mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 14990;
    background: rgba(15, 23, 42, 0.48);
    border: 0;
    padding: 0;
    margin: 0;
    touch-action: none;
  }

  .ly-mobile-nav-backdrop[hidden] {
    display: none !important;
  }

  .ly-mobile-drawer[data-mobile-nav] {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: min(90vw, 420px);
    height: 100dvh;
    max-height: 100dvh;
    z-index: 15000;
    padding:
      calc(18px + env(safe-area-inset-top, 0px))
      16px
      calc(24px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-right: 1px solid var(--ly-color-border, rgba(16,24,40,.12));
    box-shadow: 18px 0 48px rgba(15, 23, 42, 0.18);
    transform: translateX(-104%);
    transition: transform 0.22s ease;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .ly-mobile-drawer[data-mobile-nav].is-open {
    transform: translateX(0);
  }

  body.ly-mobile-nav-open {
    overflow: hidden;
    touch-action: none;
  }

  .ly-mobile-drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex: 0 0 auto;
  }

  .ly-mobile-drawer-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .ly-mobile-drawer-close {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
  }

  .ly-mobile-drawer-group {
    display: grid;
    gap: 6px;
  }

  .ly-mobile-drawer-item {
    display: block;
    padding: 13px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--ly-color-text, #101828);
    font-weight: 750;
  }

  .ly-mobile-drawer-item:hover,
  .ly-mobile-drawer-item:focus-visible {
    background: #F3F4F6;
  }

  .ly-mobile-drawer-divider {
    margin: 12px 4px 4px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ly-color-muted, #667085);
    font-weight: 800;
  }
}

@media (min-width: 993px) {
  .ly-mobile-menu-button,
  .ly-mobile-nav-backdrop,
  .ly-mobile-drawer {
    display: none !important;
  }
}

@media (max-width: 992px) {
  .ly-desktop-nav {
    display: none !important;
  }
}


