/* Marketing auth modal — overlay on Startseite */
.yama-auth-root {
  --ya-ink: #192520;
  --ya-muted: #657168;
  --ya-line: #e1e8e0;
  --ya-green: #86C922;
  --ya-green-strong: #5A8D14;
  --ya-paper: #fff;
  --ya-ui: #f3f5f3;
  --ya-radius: 12px;
  --ya-shadow: 0 12px 32px rgba(15, 20, 25, 0.08), 0 4px 8px rgba(15, 20, 25, 0.04);
  font-family: YamaHome, Arial, sans-serif;
  color: var(--ya-ink);
}
.yama-auth-root[hidden] { display: none !important; }
.yama-auth-root {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  pointer-events: auto;
}
.yama-auth-root *,
.yama-auth-root *::before,
.yama-auth-root *::after { box-sizing: border-box; }
.yama-auth-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(23, 37, 26, 0.42);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.yama-auth-modal {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: calc(100dvh - 32px);
  display: grid;
  grid-template-columns: 1fr;
  background: var(--ya-paper);
  border-radius: var(--ya-radius);
  overflow: auto;
  box-shadow: var(--ya-shadow);
}
.yama-auth-brand {
  position: relative;
  min-height: 160px;
  overflow: hidden;
  background: color-mix(in srgb, var(--ya-green) 7%, #f0f2ef);
}
.yama-auth-brand__mount {
  position: absolute;
  inset: -8% -18% -4% -12%;
  background: url("/assets/branding/yama-auth-mountains.webp") no-repeat left center / cover;
  opacity: 0.72;
  filter: saturate(0.7) contrast(0.94);
  pointer-events: none;
}
.yama-auth-brand__fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0%, transparent 45%, rgba(255,255,255,.55) 78%, #fff 100%);
}
.yama-auth-brand__logo {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ya-ink);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.yama-auth-brand__logo img { width: 28px; height: 28px; display: block; }
.yama-auth-brand__copy {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2;
}
.yama-auth-brand__title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 1px 12px rgba(25, 37, 32, 0.35);
}
.yama-auth-brand__accent { color: var(--ya-green); }
.yama-auth-brand__sub {
  display: none;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255,255,255,.9);
  text-shadow: 0 1px 10px rgba(25, 37, 32, 0.4);
}
.yama-auth-form {
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
}
.yama-auth-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.yama-auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--ya-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}
.yama-auth-back:hover { color: var(--ya-ink); }
.yama-auth-lang {
  display: flex;
  align-items: center;
  gap: 0;
  color: #b0b8b2;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.yama-auth-lang button {
  border: 0;
  background: transparent;
  color: #9aa39c;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 0;
}
.yama-auth-lang button[aria-pressed="true"] { color: var(--ya-ink); }
.yama-auth-lang button[aria-pressed="true"]::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 4px;
  margin-bottom: 1px;
  border-radius: 50%;
  background: var(--ya-green);
  vertical-align: middle;
}
.yama-auth-lang__sep { padding: 0 4px; }
.yama-auth-mark {
  display: block;
  width: 54px;
  height: 54px;
  margin: 0 auto 8px;
  object-fit: contain;
}
.yama-auth-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-align: center;
}
.yama-auth-sub {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--ya-muted);
  text-align: center;
}
.yama-auth-error {
  display: none;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fdeeee;
  color: #8a1f1f;
  font-size: 13px;
  line-height: 1.4;
}
.yama-auth-error.is-visible { display: block; }
#ya-register-error {
  margin: 4px 0 12px;
}
.yama-auth-field { margin-bottom: 12px; }
.yama-auth-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ya-muted);
}
.yama-auth-input {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 12px;
  border: 0.5px solid var(--ya-line);
  border-radius: 8px;
  background: var(--ya-ui);
}
.yama-auth-input:focus-within {
  border-color: var(--ya-green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(134, 201, 34, 0.15);
}
.yama-auth-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 12px 0;
  font: inherit;
  font-size: 13px;
  color: var(--ya-ink);
  outline: none;
}
/* Chrome/Safari Autofill malt sonst ein hellblaues Feld — auf Token-Fläche zwingen */
.yama-auth-input input:-webkit-autofill,
.yama-auth-input input:-webkit-autofill:hover,
.yama-auth-input input:-webkit-autofill:focus,
.yama-auth-input input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--ya-ink);
  caret-color: var(--ya-ink);
  box-shadow: 0 0 0 1000px var(--ya-ui) inset;
  -webkit-box-shadow: 0 0 0 1000px var(--ya-ui) inset;
  transition: background-color 99999s ease-out 0s;
}
.yama-auth-input:focus-within input:-webkit-autofill,
.yama-auth-input:focus-within input:-webkit-autofill:hover,
.yama-auth-input:focus-within input:-webkit-autofill:focus {
  box-shadow: 0 0 0 1000px #fff inset;
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
}
.yama-auth-input__icon,
.yama-auth-input__eye {
  flex-shrink: 0;
  color: #9aa39c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.yama-auth-input__eye {
  border: 0;
  background: transparent;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
}
.yama-auth-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  font-size: 12px;
}
.yama-auth-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ya-ink);
  cursor: pointer;
}
.yama-auth-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--ya-green);
}
.yama-auth-link {
  border: 0;
  background: transparent;
  color: var(--ya-green-strong);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.yama-auth-submit {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--ya-green);
  color: #17230e;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.yama-auth-submit:disabled { opacity: 0.65; cursor: wait; }
.yama-auth-submit.is-pressed,
.yama-auth-submit:active {
  filter: brightness(0.92);
  transform: scale(0.99);
}
.yama-auth-legal-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.45;
  color: #6b746e;
  -webkit-tap-highlight-color: transparent;
}
.yama-auth-legal-check input {
  appearance: none;
  -webkit-appearance: none;
  margin-top: 2px;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border: 1px solid #c5cbc6;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  position: relative;
}
.yama-auth-legal-check input:checked {
  background: #fff;
  border-color: #7a847d;
}
.yama-auth-legal-check input:checked::after {
  content: "";
  position: absolute;
  left: 3.5px;
  top: 0.5px;
  width: 3px;
  height: 7px;
  border: solid #3d4540;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.yama-auth-legal-check label {
  flex: 1;
  cursor: pointer;
  min-height: 0;
}
.yama-auth-legal-check.is-invalid {
  outline: 2px solid #c44;
  outline-offset: 4px;
  border-radius: 6px;
}
.yama-auth-sticky-cta {
  margin-top: 4px;
  padding-top: 4px;
}
.yama-auth-sticky-cta .yama-auth-error,
.yama-auth-cta-bar .yama-auth-error {
  margin: 0 0 10px;
}
.yama-auth-sticky-cta .yama-auth-submit,
.yama-auth-cta-bar .yama-auth-submit {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
.yama-auth-cta-bar {
  flex-shrink: 0;
  padding: 12px 0 4px;
  background: var(--ya-paper);
}
.yama-auth-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  top: calc(12px + env(safe-area-inset-top, 0px));
  z-index: 10001;
  display: none;
  padding: 12px 14px;
  border-radius: 10px;
  background: #8a1f1f;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(15, 20, 25, 0.2);
  pointer-events: none;
}
.yama-auth-toast.is-visible { display: block; }
.yama-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  color: #9aa39c;
  font-size: 11px;
}
.yama-auth-divider::before,
.yama-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ya-line);
}
.yama-auth-social {
  display: flex;
  justify-content: center;
}
.yama-auth-social__btn {
  min-height: 48px;
  width: min(100%, 240px);
  border-radius: 8px;
  border: 0.5px solid var(--ya-line);
  background: #fff;
  color: var(--ya-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.yama-auth-social__btn--wide {
  width: 100%;
}
.yama-auth-footer {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--ya-muted);
}
.yama-auth-footer button {
  border: 0;
  background: transparent;
  color: var(--ya-green-strong);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.yama-auth-legal {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 11px;
  color: #9aa39c;
}
.yama-auth-legal a {
  color: inherit;
  text-decoration: none;
}
.yama-auth-panel[hidden] { display: none !important; }
.yama-auth-legal-check a {
  color: var(--ya-green-strong);
  font-weight: 500;
  text-decoration: none;
}
.yama-auth-note {
  margin-top: 12px;
  text-align: center;
  font-size: 11px;
  color: #9aa39c;
}

@media (min-width: 900px) {
  .yama-auth-modal {
    grid-template-columns: minmax(280px, 1.05fr) minmax(340px, 1fr);
    min-height: min(680px, calc(100dvh - 48px));
    overflow: hidden;
  }
  .yama-auth-brand {
    min-height: 100%;
  }
  .yama-auth-brand__fade {
    background:
      linear-gradient(90deg, transparent 0%, transparent 42%, rgba(255,255,255,.55) 72%, #fff 100%),
      linear-gradient(180deg, rgba(240,242,239,.35) 0%, transparent 38%, rgba(25,37,32,.28) 100%);
  }
  .yama-auth-brand__copy {
    max-width: 28ch;
    left: 24px;
    right: 32px;
    bottom: 28px;
  }
  .yama-auth-brand__title { font-size: 28px; }
  .yama-auth-brand__sub { display: block; }
  .yama-auth-form {
    overflow: auto;
    padding: 20px 28px 28px;
  }
}

body.yama-auth-open {
  overflow: hidden;
}

/* Phone: fullscreen sheet — CTA fixed outside scroll (Pixel keyboard-safe) */
@media (max-width: 899px) {
  .yama-auth-root {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }
  .yama-auth-modal {
    width: 100%;
    max-height: 100dvh;
    max-height: 100vh;
    height: 100dvh;
    height: 100vh;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .yama-auth-brand {
    flex-shrink: 0;
    min-height: 96px;
  }
  .yama-auth-form {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 12px 16px 0;
  }
  .yama-auth-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .yama-auth-panel--register {
    overflow: auto;
  }
  .yama-auth-register-form {
    display: block;
    margin: 0;
    padding-bottom: 8px;
  }
  .yama-auth-panel[hidden] { display: none !important; }
  .yama-auth-register-form .yama-auth-submit {
    margin-top: 4px;
    margin-bottom: 8px;
  }
  .yama-auth-register-form #ya-register-error {
    margin: 0 0 10px;
  }
  .yama-auth-chrome { flex-shrink: 0; }
}
