/* ==========================================================
   BoşKoltuk – Giriş / Kayıt ekranı (bölünmüş düzen, iç içe kart,
   kayan hata bandı, açık/koyu tema)
   ========================================================== */
.ml {
  /* Açık tema – BoşKoltuk paleti */
  --ml-accent: #d62839;
  --ml-accent-hover: #c01f30;
  --ml-page: #f4f1ec;
  --ml-shell: #ebe6df;         /* dış kart (hata bandı + alt yazı) */
  --ml-card: #ffffff;          /* iç kart */
  --ml-input: #f4f1ec;
  --ml-border: #e4ded6;
  --ml-fg: #1b1b1d;
  --ml-muted: #6f6a64;
  --ml-hero-bg: #efe9e1;
  --ml-hero-glow1: rgba(214, 40, 57, .30);
  --ml-hero-glow2: rgba(255, 150, 110, .22);
  --ml-error-bg: #fde8ea;
  --ml-error-fg: #c81e30;
  --ml-shadow: 0 24px 60px rgba(60, 40, 30, .10);

  min-height: 100vh; box-sizing: border-box;
  display: grid; grid-template-columns: minmax(340px, 440px) 1fr;
  gap: 12px; padding: 12px;
  background: var(--ml-page); color: var(--ml-fg);
  font-family: inherit;
  transition: background .3s, color .3s;
}
.ml *, .ml *::before, .ml *::after { box-sizing: border-box; }

.ml[data-theme="dark"] {
  --ml-page: #161617;
  --ml-shell: #0f0f10;
  --ml-card: #1c1c1e;
  --ml-input: #242427;
  --ml-border: #2c2c30;
  --ml-fg: #f2f2f3;
  --ml-muted: #9a9aa1;
  --ml-hero-bg: #222224;
  --ml-hero-glow1: rgba(214, 40, 57, .38);
  --ml-hero-glow2: rgba(120, 60, 110, .30);
  --ml-error-bg: rgba(214, 40, 57, .16);
  --ml-error-fg: #ff5a68;
  --ml-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

/* ---------- Sol panel ---------- */
.ml-hero {
  position: relative; overflow: hidden; border-radius: 20px;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 28px; background: var(--ml-hero-bg);
  transition: background .3s;
}
.ml-hero::before {
  content: ""; position: absolute; inset: -20% -30% 30% -30%;
  background:
    radial-gradient(60% 55% at 25% 15%, var(--ml-hero-glow1), transparent 70%),
    radial-gradient(50% 50% at 75% 35%, var(--ml-hero-glow2), transparent 70%);
  filter: blur(20px);
  animation: ml-float 14s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes ml-float { to { transform: translate(6%, 4%) scale(1.08); } }
.ml-hero > * { position: relative; }

.ml-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.ml-logo-mark {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--ml-accent); color: #fff;
}
.ml-logo-mark { background: #f4f1ec; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.ml-logo-mark svg { width: 24px; height: 24px; }
.ml-logo-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }

.ml-hero h1 { margin: 0 0 12px; font-size: clamp(30px, 3.2vw, 40px); line-height: 1.12; font-weight: 600; letter-spacing: -.025em; }
.ml-hero p { margin: 0; max-width: 300px; font-size: 15px; line-height: 1.5; color: var(--ml-muted); }
.ml-hero-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }

/* Tema düğmesi */
.ml-theme { display: flex; gap: 4px; flex: none; }
.ml-theme button {
  width: 34px; height: 34px; border-radius: 9px; border: 0; cursor: pointer;
  display: grid; place-items: center; color: var(--ml-muted); background: transparent;
  transition: background .2s, color .2s;
}
.ml-theme button svg { width: 17px; height: 17px; }
.ml-theme button:hover { color: var(--ml-fg); }
.ml-theme button[aria-pressed="true"] { background: var(--ml-card); color: var(--ml-fg); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- Sağ: form ---------- */
.ml-main { display: grid; place-items: center; padding: 24px 12px; }

/* Dış kabuk: hata bandını ve alt yazıyı taşır */
.ml-shell {
  width: min(400px, 100%);
  background: var(--ml-shell); border-radius: 20px; padding: 4px;
  box-shadow: var(--ml-shadow);
  transition: background .3s;
}

/* Hata bandı – kartın arkasından aşağı kayar */
.ml-error {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .35s cubic-bezier(.2, .8, .2, 1);
}
.ml-error > div { overflow: hidden; }
.ml-error-inner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px 12px; font-size: 14px; font-weight: 500;
  color: var(--ml-error-fg);
  background: linear-gradient(180deg, var(--ml-error-bg), transparent 140%);
  border-radius: 16px 16px 0 0;
  transform: translateY(100%); opacity: 0;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .25s;
}
.ml-error-inner svg { width: 18px; height: 18px; flex: none; }
.ml-shell.has-error .ml-error { grid-template-rows: 1fr; }
.ml-shell.has-error .ml-error-inner { transform: none; opacity: 1; }

/* İç kart */
.ml-card {
  position: relative; z-index: 1;
  background: var(--ml-card); border: 1px solid var(--ml-border);
  border-radius: 16px; padding: 22px 20px 20px;
  transition: background .3s, border-color .3s;
}
.ml-card.shake { animation: ml-shake .4s ease; }
@keyframes ml-shake { 20%,60% { transform: translateX(-5px); } 40%,80% { transform: translateX(5px); } }

.ml-title { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.ml-sub { margin: 0 0 18px; font-size: 14px; line-height: 1.45; color: var(--ml-muted); }

.ml-field { margin-bottom: 14px; }
.ml-label-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.ml-label { font-size: 14px; font-weight: 500; }
.ml-link {
  font: inherit; font-size: 13px; color: var(--ml-muted); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: none; transition: color .2s;
}
.ml-link:hover { color: var(--ml-fg); text-decoration: underline; }

.ml-input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 11px;
  font: inherit; font-size: 16px; color: var(--ml-fg); /* 16px altı iPhone'da odaklanınca sayfayı yakınlaştırır */
  background: var(--ml-input); border: 1px solid var(--ml-border); outline: none;
  transition: border-color .2s, box-shadow .2s, background .3s;
}
.ml-input::placeholder { color: var(--ml-muted); opacity: .8; }
.ml-input:focus { border-color: var(--ml-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ml-accent) 18%, transparent); }
.ml-shell.has-error .ml-input { border-color: color-mix(in srgb, var(--ml-error-fg) 45%, var(--ml-border)); }

.ml[data-mode="register"] .ml-only-login { display: none; }
.ml[data-mode="login"] .ml-only-register { display: none; }

.ml-submit {
  position: relative; width: 100%; height: 46px; margin-top: 6px; border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 16px; font-weight: 600; color: #fff; background: var(--ml-accent);
  transition: background .2s, transform .12s, opacity .2s;
}
.ml-submit:hover { background: var(--ml-accent-hover); }
.ml-submit:active { transform: scale(.985); }
.ml-submit[aria-busy="true"] { color: transparent; pointer-events: none; }
.ml-submit[aria-busy="true"]::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: ml-spin .7s linear infinite;
}
@keyframes ml-spin { to { transform: rotate(360deg); } }

.ml-foot { padding: 14px 12px 12px; text-align: center; font-size: 14px; color: var(--ml-muted); }
.ml-foot .ml-link { font-size: 14px; color: var(--ml-fg); font-weight: 600; margin-left: 4px; }

.ml :focus-visible { outline: 2px solid var(--ml-accent); outline-offset: 2px; }
.ml .ml-input:focus-visible { outline: none; }

/* Onay / bilgi mesajı (ör. "onay bağlantısı gönderdik") */
.ml-sub.is-ok { color: var(--ml-fg); }
.ml-sub.is-ok b { color: #1b8748; }

/* ---------- Mobil ---------- */
@media (max-width: 820px) {
  .ml { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .ml-hero { min-height: 190px; padding: 20px; gap: 22px; }
  .ml-hero h1 { font-size: 26px; margin-bottom: 6px; }
  .ml-hero p { font-size: 14px; }
  .ml-main { place-items: start center; padding: 8px 0 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .ml-hero::before, .ml-card.shake { animation: none; }
  .ml-error, .ml-error-inner { transition: none; }
}
