/* Ayt Karşılama — Giriş ekranı */

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

:root {
  --navy-900: #081026;
  --navy-800: #0c1a3a;
  --navy-700: #122a52;
  --ink: #1a2233;
  --ink-soft: #5b667d;
  --ink-faint: #8a93a6;
  --line: #e7e9f0;
  --line-soft: #eef0f5;
  --gold: #c9a227;
  --gold-soft: #e3c558;
  --white: #ffffff;
  --field-bg: #f8f9fc;
  --radius: 18px;
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body { height: 100%; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: #0a1226;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* native app davranışları */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
  touch-action: manipulation;
}

/* Metin girişlerinde seçime izin ver */
input, textarea { -webkit-user-select: text; user-select: text; }

/* ---------- Stage ---------- */
.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  padding-top: max(28px, env(safe-area-inset-top));
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  padding-left: max(28px, env(safe-area-inset-left));
  padding-right: max(28px, env(safe-area-inset-right));
  overflow-x: hidden;
  overflow-y: auto;
}

/* ---------- Backdrop ---------- */
.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, #16264f 0%, #0c1a3a 45%, #070e22 100%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .5;
}
.glow--gold {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(201,162,39,.55), transparent 70%);
  top: -180px; right: -120px;
  opacity: .35;
}
.glow--blue {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(43,76,160,.6), transparent 70%);
  bottom: -220px; left: -160px;
}

/* Uçuş rotası — premium havayolu dokunuşu */
.route { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
.route__line {
  fill: none;
  stroke: rgba(201,162,39,.35);
  stroke-width: 1.5;
  stroke-dasharray: 6 8;
  filter: drop-shadow(0 0 6px rgba(201,162,39,.25));
}
.route__dot { fill: var(--gold-soft); filter: drop-shadow(0 0 6px rgba(227,197,88,.8)); }
.route__dot--a { offset-path: path("M-50 720 C 320 680, 480 360, 760 320 S 1180 200, 1520 120"); animation: fly 14s linear infinite; }
.route__dot--b { offset-path: path("M-50 720 C 320 680, 480 360, 760 320 S 1180 200, 1520 120"); animation: fly 14s linear infinite; animation-delay: 7s; }
@keyframes fly { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@media (prefers-reduced-motion: reduce) { .route__dot { animation: none; } }

/* ---------- Card ---------- */
.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 412px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 44px 40px 30px;
  box-shadow:
    0 40px 80px -20px rgba(5, 12, 32, .55),
    0 8px 24px -8px rgba(5, 12, 32, .35);
  overflow: hidden;
}

/* Üst altın hairline */
.card__edge {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold) 25%, var(--gold-soft) 50%, var(--gold) 75%, transparent);
}

/* ---------- Brand ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 30px;
}
.brand__mark {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(140deg, #11244e, #0c1a3a);
  box-shadow: inset 0 0 0 1px rgba(201,162,39,.45), 0 6px 16px rgba(8,16,38,.35);
}
.brand__mark svg { color: var(--gold-soft); }
.brand__name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--ink);
}

/* ---------- Intro ---------- */
.intro { margin-bottom: 26px; }
.intro__title {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  margin-bottom: 6px;
}
.intro__sub {
  font-size: 14.5px;
  font-weight: 400;
  color: var(--ink-soft);
}

/* ---------- Form ---------- */
.field { margin-bottom: 18px; }
.field__label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.field__control {
  position: relative;
  display: flex;
  align-items: center;
}
.field__icon {
  position: absolute;
  left: 15px;
  color: var(--ink-faint);
  pointer-events: none;
  transition: color .18s ease;
}
.field__control input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 44px;
  font-family: var(--font);
  font-size: 16px; /* iOS otomatik zoom engelleme */
  color: var(--ink);
  background: var(--field-bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.field__control input::placeholder { color: var(--ink-faint); }
.field__control input:hover { border-color: #d4d8e4; }
.field__control input:focus {
  background: #fff;
  border-color: var(--navy-800);
  box-shadow: 0 0 0 4px rgba(18, 36, 78, .08);
}
.field__control input:focus ~ .field__icon,
.field__control:focus-within .field__icon { color: var(--navy-800); }

.field__toggle {
  position: absolute;
  right: 8px;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  border-radius: 9px;
  transition: color .15s ease, background .15s ease;
}
.field__toggle:hover { color: var(--ink-soft); background: #eef0f6; }
.field__toggle.is-on { color: var(--navy-800); }

/* ---------- Actions ---------- */
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
}
.btn {
  flex: 0 0 auto;
  height: 50px;
  padding: 0 30px;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #fff;
  background: linear-gradient(135deg, #14264f 0%, #0c1a3a 100%);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  box-shadow: 0 10px 22px -8px rgba(12, 26, 58, .7);
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(201,162,39,.25), transparent);
  transform: translateX(-100%);
  transition: transform .5s ease;
}
.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 16px 28px -10px rgba(12, 26, 58, .8);
}
.btn:hover::after { transform: translateX(100%); }
.btn:active { transform: translateY(0); }

.forgot {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  position: relative;
  transition: color .15s ease;
}
.forgot::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 100%; height: 1.5px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .25s ease;
}
.forgot:hover { color: var(--navy-800); }
.forgot:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Foot ---------- */
.card__foot {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}
.card__foot span {
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ink-faint);
}

/* ---------- Tablet ---------- */
@media (max-width: 768px) and (min-width: 601px) {
  .card { max-width: 460px; padding: 48px 44px 32px; }
}

/* ---------- Mobil: tam ekran native app görünümü ---------- */
@media (max-width: 600px) {
  .stage { padding: 0; }

  .card {
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 26px;
    padding-top: max(44px, calc(env(safe-area-inset-top) + 28px));
    padding-bottom: max(28px, calc(env(safe-area-inset-bottom) + 18px));
    padding-left: max(26px, env(safe-area-inset-left));
    padding-right: max(26px, env(safe-area-inset-right));
  }

  .card__edge { height: 0; } /* tam ekranda üst çizgi gizli */
  .brand { margin-bottom: 38px; justify-content: center; }
  .intro { margin-bottom: 30px; text-align: center; }
  .intro__title { font-size: 27px; }

  .actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 16px;
    margin-top: 30px;
  }
  .btn { width: 100%; height: 54px; font-size: 14px; }
  .forgot { text-align: center; padding: 6px; }

  .card__foot { margin-top: auto; padding-top: 26px; }
}

/* Yatay (landscape) küçük ekranlarda dikey ortala */
@media (max-height: 560px) and (max-width: 600px) {
  .card { justify-content: flex-start; }
}

/* ============================================================
   KAYIT FORMU + GÖRÜNÜM GEÇİŞİ + LOADING/BAŞARI
   ============================================================ */

/* Kartı overlay için konumlandır */
.card { position: relative; }

/* Görünüm panelleri */
.view { }
.view[hidden] { display: none; }

/* Panel giriş animasyonu */
@keyframes viewEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.view--enter { animation: viewEnter .4s cubic-bezier(.22,.61,.36,1) both; }
@media (prefers-reduced-motion: reduce) { .view--enter { animation: none; } }

/* Zorunlu / opsiyonel etiket işaretleri */
.req { color: #e0483d; font-weight: 700; margin-left: 1px; }
.opt { color: var(--ink-faint); font-weight: 400; font-size: 11.5px; }

/* Hata mesajı */
.field__error {
  display: block;
  min-height: 0;
  font-size: 12px;
  color: #e0483d;
  font-weight: 500;
  margin-top: 6px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .2s ease, opacity .2s ease, margin .2s ease;
}

/* Geçersiz alan — kırmızı */
.field--invalid .field__control input {
  border-color: #e0483d;
  background: #fff5f4;
}
.field--invalid .field__control input:focus {
  box-shadow: 0 0 0 4px rgba(224, 72, 61, .12);
}
.field--invalid .field__icon { color: #e0483d; }
.field--invalid .field__error {
  max-height: 40px;
  opacity: 1;
  margin-top: 6px;
}

/* Tam genişlik buton */
.btn--block { width: 100%; display: block; margin-top: 6px; }

/* Giriş Yap'a dön linki */
.switch {
  text-align: center;
  margin-top: 20px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.switch a {
  color: var(--navy-800);
  font-weight: 600;
  text-decoration: none;
  margin-left: 3px;
}
.switch a:hover { text-decoration: underline; }

/* Başarı bildirim bandı (giriş ekranı) */
.notice {
  border-radius: 11px;
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 22px;
  transition: opacity .4s ease;
}
.notice--success {
  background: #e9f9f0;
  color: #0c7a47;
  border: 1px solid rgba(16,185,129,.28);
}

/* ---------- Overlay (loading + başarı) ---------- */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 5;
  opacity: 0;
  transition: opacity .25s ease;
  border-radius: inherit;
}
.overlay.is-on { opacity: 1; }
.overlay[hidden] { display: none; }
.overlay__inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.overlay__text { font-size: 14px; font-weight: 500; color: var(--ink-soft); }

/* Spinner */
.spinner {
  width: 38px; height: 38px;
  border: 3px solid rgba(12,26,58,.15);
  border-top-color: var(--navy-800);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
.spinner--sm {
  width: 15px; height: 15px;
  border-width: 2px;
  border-top-color: #fff;
  border-color: rgba(255,255,255,.35);
  border-top-color: #fff;
  vertical-align: -2px;
  margin-right: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Başarı tiki (animasyonlu) */
.overlay__check { display: block; }
.overlay__check[hidden] { display: none; }
.overlay__check-circle {
  stroke: #16a86a;
  stroke-width: 2.5;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
}
.overlay__check-mark {
  stroke: #16a86a;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
}
.overlay__check.is-on .overlay__check-circle { animation: drawCircle .5s ease forwards; }
.overlay__check.is-on .overlay__check-mark { animation: drawMark .35s .45s ease forwards; }
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawMark { to { stroke-dashoffset: 0; } }

/* Loading sırasında submit butonu */
.btn.is-loading { pointer-events: none; opacity: .85; }

/* Kayıt formunda alanları biraz sıkılaştır */
[data-panel="register"] .field { margin-bottom: 15px; }
[data-panel="register"] .intro { margin-bottom: 22px; }

/* ---------- Mobil: kayıt formu uzun → tam ekran + akış ---------- */
@media (max-width: 600px) {
  .card[data-view="register"] { justify-content: flex-start; }
  [data-panel="register"] .btn--block { height: 54px; }
}

/* ============ Uygulama indirme rozetleri (giriş ekranı) ============ */
.appbar {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}
.appbar__label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .03em;
  color: var(--ink-faint);
  margin-bottom: 12px;
}
.appbar__badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.store {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  min-width: 142px;
  background: linear-gradient(135deg, #14264f 0%, #0c1a3a 100%);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 11px;
  color: #fff;
  cursor: pointer;
  font-family: var(--font);
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
  box-shadow: 0 6px 16px -8px rgba(12,26,58,.6);
}
.store:hover { transform: translateY(-1px); filter: brightness(1.1); box-shadow: 0 10px 20px -8px rgba(12,26,58,.75); }
.store:active { transform: translateY(0); }
.store__logo { flex-shrink: 0; }
.store__txt { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store__txt small { font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.7); }
.store__txt strong { font-size: 14px; font-weight: 600; letter-spacing: .01em; }

@media (max-width: 380px) {
  .store { min-width: 100%; justify-content: center; }
}

/* ============ Giriş ekranı: butonlar + linkler + hata ============ */
.login-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.login-links__sep { color: var(--ink-faint); font-size: 12px; }
.link-btn {
  background: none;
  border: 0;
  padding: 4px 2px;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy-800);
  cursor: pointer;
  position: relative;
}
.link-btn::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1.5px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .25s ease;
}
.link-btn:hover::after { transform: scaleX(1); transform-origin: left; }

/* Giriş input hata (kırmızı) */
.field__control input.input--error {
  border-color: #e0483d;
  background: #fff5f4;
}
.field__control input.input--error:focus {
  box-shadow: 0 0 0 4px rgba(224, 72, 61, .12);
}

/* Hata bildirim bandı */
.notice--error {
  background: #fdecea;
  color: #b3261e;
  border: 1px solid rgba(224,72,61,.28);
}

/* ============ Geri butonu (kayıt / şifremi unuttum) ============ */
.backbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 8px 12px 8px 6px;
  margin: -8px 0 14px -6px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 10px;
  min-height: 40px;
  transition: color .15s ease, background .15s ease;
}
.backbtn:hover { color: var(--navy-800); background: #f1f3f8; }
.backbtn:active { background: #e8ebf3; }
.backbtn svg { flex-shrink: 0; }
