/* =====================================================================
   GİRİŞ / KAYIT PENCERESİ (auth-ui.js)
   Boyutlar: telefon ≤ 352×620 · tablet 560×700 · geniş ekran 1120×min(776, ekran−64)
   Geniş ekranda sol yarı tanıtım slaytı, sağ yarı form.
   Butonlar: köşe 12, 1px %10 beyaz çerçeve, 14px yarı kalın · kapat düğmesi 32, köşe 16
   ===================================================================== */
.auth { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; }
.auth[hidden] { display: none; }
.auth-backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .22s ease;
}
.auth.open .auth-backdrop { opacity: 1; }

.auth-dialog {
  position: relative; display: flex; overflow: hidden;
  width: calc(100% - 24px); max-width: 352px; height: 620px; max-height: calc(100dvh - 24px);
  background: #131517; border: 1px solid rgba(255, 255, 255, .06); border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  opacity: 0; transform: translateY(10px) scale(.98);
  transition: opacity .22s ease, transform .26s cubic-bezier(.2, .8, .2, 1);
}
.auth.open .auth-dialog { opacity: 1; transform: none; }
@media (min-width: 768px) {
  .auth-dialog { width: 560px; max-width: calc(100vw - 48px); height: 700px; max-height: calc(100dvh - 48px); }
}
@media (min-width: 1280px) {
  .auth-dialog { width: 1120px; max-width: calc(100vw - 64px); height: min(776px, calc(100dvh - 64px)); }
}

.auth-x {
  position: absolute; top: 12px; right: 12px; z-index: 10; width: 28px; height: 28px; border-radius: 16px;
  display: grid; place-items: center; color: #d6d6d6;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .04); transition: background .15s;
}
.auth-x:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.auth-x svg { width: 16px; height: 16px; stroke-width: 2; }
@media (min-width: 768px) { .auth-x { top: 20px; right: 20px; width: 32px; height: 32px; } }

/* ---- sol: tanıtım slaytı (yalnızca geniş ekran) ---- */
.auth-media { display: none; width: 50%; min-height: 0; padding: 12px; }
@media (min-width: 1280px) { .auth-media { display: block; } }
.auth-media-inner { position: relative; height: 100%; border-radius: 12px; overflow: hidden; background: #000; }
.auth-slides { position: absolute; inset: 0; }
.auth-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.auth-slide.on { opacity: 1; }
.auth-slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 6s ease-out; }
.auth-slide.on img { transform: scale(1); }
.auth-slide-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .2) 50%, rgba(0, 0, 0, .8) 100%); }
.auth-media-copy { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px; display: flex; flex-direction: column; gap: 32px; }
.auth-media-text { display: flex; flex-direction: column; gap: 12px; }
.auth-tags { display: flex; gap: 4px; }
.auth-tags span {
  display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 8px;
  font-size: 10px; line-height: 14px; font-weight: 600; color: #fff;
  background: rgba(255, 255, 255, .1); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.auth-media-head { display: flex; flex-direction: column; gap: 6px; }
.auth-media-title {
  font-family: "Space Grotesk", "Inter", sans-serif; font-size: 40px; line-height: 48px; font-weight: 700;
  letter-spacing: -0.8px; text-transform: uppercase; color: #fff;
}
.auth-media-desc { font-size: 14px; line-height: 20px; color: rgba(255, 255, 255, .5); max-width: 420px; }
.auth-progress { display: flex; flex-direction: column; gap: 8px; }
.auth-bars, .auth-labels { display: flex; gap: 4px; }
.auth-bars button { flex: 1; min-width: 0; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .2); overflow: hidden; padding: 0; }
.auth-bars span { display: block; height: 100%; width: 0; border-radius: 99px; background: #fff; }
.auth-labels button {
  flex: 1; min-width: 0; text-align: left; font-size: 12px; line-height: 18px; color: rgba(255, 255, 255, .4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s; padding: 0;
}
.auth-labels button:hover { color: rgba(255, 255, 255, .6); }
.auth-labels button.on { color: #fff; font-weight: 500; }

/* ---- sağ: form ---- */
.auth-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 24px 20px; overflow-y: auto; scrollbar-width: none; }
.auth-panel::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .auth-panel { padding: 32px 88px; } }
.auth-step { width: 100%; margin: auto 0; display: flex; flex-direction: column; }
.auth-step[hidden] { display: none; }

.auth-head { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; margin-bottom: 24px; }
@media (min-width: 768px) { .auth-head { margin-bottom: 40px; } }
.auth-logo { width: 40px; height: 40px; }
.auth-titles { display: flex; flex-direction: column; gap: 12px; }
.auth-title { font-size: 24px; line-height: 32px; font-weight: 600; text-wrap: balance; color: #fff; }
.auth-sub { font-size: 14px; line-height: 20px; color: #898a8b; }

.auth-methods { display: flex; flex-direction: column; gap: 12px; }
.auth-method {
  position: relative; width: 100%; padding: 14px 16px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: #fff;
  border: 1px solid rgba(255, 255, 255, .1); background: transparent; transition: border-color .15s, background .15s;
}
@media (min-width: 768px) { .auth-method { padding: 20px 16px; } }
.auth-method:hover { border-color: #fff; }
.auth-method svg { width: 20px; height: 20px; }
.auth-method .g-logo { stroke: none; }
.auth-or { display: flex; align-items: center; gap: 12px; color: #5c5d61; font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .06); }

.auth-legal { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .08); text-align: center; font-size: 12px; line-height: 18px; color: #898a8b; }
.auth-legal a { color: #cfd0d2; text-decoration: underline; text-underline-offset: 2px; }

.auth-error { display: none; margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 18px; color: #ffb3b8; background: rgba(255, 70, 90, .1); border: 1px solid rgba(255, 70, 90, .2); }
.auth-error.on { display: block; }

/* ---- e-posta adımı ---- */
.auth-back {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px;
  padding: 6px 10px 6px 6px; border-radius: 10px; font-size: 13px; font-weight: 500; color: #898a8b; transition: background .15s, color .15s;
}
.auth-back:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.auth-back svg { width: 16px; height: 16px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field[hidden] { display: none; }
.auth-field > span { font-size: 12px; line-height: 16px; font-weight: 500; color: #898a8b; }
.auth-field em { font-style: normal; color: #5c5d61; }
.auth-field input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px;
  background: #1c1e20; border: 1px solid rgba(255, 255, 255, .08); color: #fff;
  font: 400 14px "Inter", sans-serif; outline: none; transition: border-color .15s, box-shadow .15s;
}
.auth-field input::placeholder { color: #5c5d61; }
.auth-field input:focus { border-color: rgba(30, 155, 255, .6); box-shadow: 0 0 0 3px rgba(30, 155, 255, .15); }
.auth-pass { position: relative; }
.auth-pass input { padding-right: 46px; }
.auth-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #898a8b; }
.auth-eye:hover, .auth-eye.on { color: #fff; }
.auth-eye svg { width: 18px; height: 18px; }
.auth-hint { font-size: 12px; color: #5c5d61; }
.auth-hint[hidden] { display: none; }
.auth-form .auth-error { margin-bottom: 0; }

.auth-submit {
  position: relative; height: 48px; margin-top: 4px; border-radius: 12px; padding: 0 24px 2px;
  font-size: 14px; font-weight: 600; color: #fff;
  background: radial-gradient(circle, #6fd0ff 40%, #1e8fff 100%);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .43); transition: opacity .2s;
}
.auth-submit:hover { opacity: .85; }
.auth-submit:active { opacity: .7; }
.auth-submit:disabled { cursor: wait; opacity: .7; }
.auth-submit.loading span { visibility: hidden; }
.auth-submit.loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -10px 0 0 -9px;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: auth-spin .8s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-switch { margin-top: 18px; text-align: center; font-size: 13px; color: #898a8b; }
.auth-switch button { color: var(--accent); font-weight: 600; }
.auth-switch button:hover { text-decoration: underline; }

/* ---- giriş yapmış kullanıcı: profil yuvarlağı + menü ---- */
.avatar span { display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #06142b; background-size: cover; background-position: center; }
.avatar span.pic { background-color: #222; }
.user-menu {
  position: fixed; z-index: 250; min-width: 220px; padding: 6px; border-radius: 14px;
  background: rgba(28, 30, 32, .97); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
}
.user-menu[hidden] { display: none; }
.um-who { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid rgba(255, 255, 255, .06); margin-bottom: 4px; }
.um-who b { font-size: 14px; font-weight: 600; color: #fff; }
.um-who span { font-size: 12px; color: #898a8b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu button { width: 100%; text-align: left; padding: 9px 10px; border-radius: 9px; font-size: 14px; font-weight: 500; color: #e6e6e6; }
.user-menu button:hover { background: rgba(255, 255, 255, .06); }

@media (prefers-reduced-motion: reduce) {
  .auth-backdrop, .auth-dialog, .auth-slide, .auth-slide img { transition: none; }
}
