/* Avataria Türkiye — auth (login + register) stili
   Splash screen ile aynı palet (koyu mavi gradient + gold/accent).
   bg.png arka plan resmi kaldırıldı — Electron'da yüklenmiyordu, plus pure
   CSS gradient her ortamda tutarlı görünür. */

:root {
  --bg-deep:   #0a0e1c;       /* splash bg ile aynı */
  --bg-card:   #161a2e;       /* topbar gradient ile aynı */
  --bg-soft:   #1f2440;
  --text:      #e2ecff;
  --muted:     rgba(207, 226, 255, 0.72);
  --line:      rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.06);
  --brand:     #ffd57a;       /* gold */
  --accent:    #5b8def;       /* electric blue */
  --pink:      #ff5fb3;       /* secondary highlight */
  --error-bg:  rgba(232, 17, 35, 0.12);
  --error-fg:  #ff8a8a;
  --ok-bg:     rgba(108, 201, 90, 0.12);
  --ok-fg:     #bff5b0;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(91,141,239,0.18) 0%, transparent 45%),
    radial-gradient(circle at 80% 90%, rgba(255,213,122,0.10) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255,95,179,0.06) 0%, transparent 60%),
    linear-gradient(160deg, var(--bg-deep) 0%, var(--bg-card) 100%);
}

/* ===================== LAYOUT ===================== */

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 32px 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(22, 26, 46, 0.72);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.auth-card--wide {
  width: min(540px, 100%);
}

@supports (backdrop-filter: blur(14px)) {
  .auth-card {
    background: rgba(22, 26, 46, 0.55);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
  }
}

/* ===== SPLIT LAYOUT (sol: branding/info — sağ: form) ===== */
.auth-split {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(22, 26, 46, 0.72);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}
@supports (backdrop-filter: blur(14px)) {
  .auth-split {
    background: rgba(22, 26, 46, 0.55);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
  }
}

.auth-side {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Sol bölme — branding + welcome + feature listesi */
.auth-side--info {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 0%, rgba(255, 95, 179, 0.20) 0%, transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(91, 141, 239, 0.22) 0%, transparent 55%),
    linear-gradient(160deg, rgba(22, 26, 46, 0.5) 0%, rgba(10, 14, 28, 0.5) 100%);
  border-right: 1px solid var(--line-soft);
  justify-content: center;
}
/* Dekoratif gradient orb (sol alt köşede yumuşak ışık) */
.auth-side--info::before {
  content: "";
  position: absolute;
  bottom: -60px; left: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(91, 141, 239, 0.35) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}
.auth-side--info::after {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255, 95, 179, 0.30) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}
.auth-side--info > * { position: relative; z-index: 1; }

.auth-side--info .auth-logo {
  width: min(220px, 78%);
  margin: 0 0 26px;
}
.auth-side--info h2 {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  background: linear-gradient(135deg, #fff 0%, #cfe2ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-side--info .lead {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.auth-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.auth-features li:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 213, 122, 0.15);
  transform: translateX(2px);
}
.auth-features .ic {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--brand) 100%);
  color: #0a0e1c;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(91, 141, 239, 0.30);
}

/* Sağ bölme — form alanı */
.auth-side--form {
  justify-content: center;
}
.auth-side--form .auth-head {
  text-align: left;
  margin-bottom: 8px;
}
.auth-side--form h1 {
  font-size: 26px;
}

/* Mobil / dar pencere: dikey stack */
@media (max-width: 820px) {
  .auth-split {
    grid-template-columns: 1fr;
    width: min(440px, 100%);
  }
  .auth-side--info {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 28px 26px;
  }
  .auth-side--info .auth-logo { margin: 0 auto 14px; }
  .auth-side--info h2  { text-align: center; }
  .auth-side--info .lead { text-align: center; }
  .auth-features { display: none; }
  .auth-side--form { padding: 28px 26px; }
}

/* ===== SAYFA GEÇİŞ + LOADING ANİMASYONLARI =====
   auth-transitions.js script'i body'e class ekler:
     .auth-loaded   → giriş animasyonu (fade + slide-up)
     .auth-leaving  → çıkış animasyonu (fade + slide-down), sonra yeni sayfa
     .auth-loading  → form submit overlay (full-screen spinner) */

.auth-page {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease-out, transform 0.22s ease-out;
}
.auth-loaded .auth-page {
  opacity: 1;
  transform: translateY(0);
}
.auth-leaving .auth-page {
  opacity: 0;
  transform: translateY(-8px);
}

/* Loading overlay — form submit sırasında veya geçiş esnasında */
.auth-loading::before {
  content: "";
  position: fixed; inset: 0;
  background: rgba(10, 14, 28, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  animation: auth-overlay-in 0.18s ease-out;
}
.auth-loading::after {
  content: "";
  position: fixed;
  top: 50%; left: 50%;
  width: 54px; height: 54px;
  margin: -27px;
  border: 4px solid rgba(255, 213, 122, 0.18);
  border-top-color: #ffd57a;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
  z-index: 10001;
  box-shadow: 0 0 24px rgba(255, 213, 122, 0.25);
}
@keyframes auth-spin    { to { transform: rotate(360deg); } }
@keyframes auth-overlay-in {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to   { opacity: 1; backdrop-filter: blur(6px); }
}

/* ===== ELECTRON LAUNCHER MODU =====
   body.ava-electron class'ı launcher tarafından inject edilir.
   Bu modda split form pencerenin TAMAMINI doldurur — corner/border/box-shadow
   yok, scrollbar yok, padding sıfır. Browser'da klasik card davranışı korunur. */
.ava-electron,
.ava-electron body {
  overflow: hidden !important;
  height: 100vh !important;
}
.ava-electron .auth-page {
  min-height: 100vh !important;
  padding: 0 !important;
  display: block !important;
}
.ava-electron .auth-split {
  width: 100% !important;
  height: 100vh !important;
  max-width: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.ava-electron .auth-side {
  height: 100vh !important;
  padding: 56px 48px !important;        /* topbar (44px) + biraz nefes */
}
/* Sol info panel — sabit içerik, scroll asla çıkmaz */
.ava-electron .auth-side--info {
  border-right: 1px solid var(--line-soft) !important;
  overflow: hidden !important;
}
/* Sağ form panel — sadece içerik taşarsa scroll (login'de çıkmaz, register'da çıkar) */
.ava-electron .auth-side--form {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* ===== MODERN CUSTOM SCROLLBAR (brand uyumlu, ince) ===== */
.auth-side--form::-webkit-scrollbar,
.auth-split::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.auth-side--form::-webkit-scrollbar-track,
.auth-split::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
.auth-side--form::-webkit-scrollbar-thumb,
.auth-split::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(91, 141, 239, 0.45) 0%, rgba(91, 141, 239, 0.30) 100%);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.auth-side--form::-webkit-scrollbar-thumb:hover,
.auth-split::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 213, 122, 0.55) 0%, rgba(91, 141, 239, 0.45) 100%);
}
.auth-side--form::-webkit-scrollbar-corner,
.auth-split::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner {
  background: transparent;
}
/* Firefox scrollbar */
.auth-side--form,
.auth-split,
body {
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 141, 239, 0.45) rgba(255, 255, 255, 0.02);
}
/* Tek-card sayfalar (.auth-card kullanılan eski layout) — Electron'da tam ekran */
.ava-electron .auth-card,
.ava-electron .auth-card--wide {
  width: 100% !important;
  max-width: 480px !important;          /* card kendisi merkezi kalsın */
  margin: 0 auto !important;
  border-radius: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* Dar pencerede (mobil break) Electron'da da dikey stack */
@media (max-width: 820px) {
  .ava-electron .auth-side {
    height: auto !important;
  }
  .ava-electron .auth-split {
    height: 100vh !important;
    overflow-y: auto !important;
  }
}

/* ===================== LOGO + HEADER ===================== */

.auth-logo {
  width: min(280px, 80%);
  display: block;
  margin: 0 auto 16px;
}

.auth-logo img {
  width: 100%;
  display: block;
  filter: drop-shadow(0 12px 28px rgba(91, 141, 239, 0.32));
}

.auth-head {
  text-align: center;
  margin-bottom: 4px;
}

.auth-head span {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand);
  background: rgba(255, 213, 122, 0.08);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
}

p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* ===================== FORM ===================== */

.auth-form { margin-top: 22px; }

label {
  display: block;
  margin: 16px 0 7px;
  color: var(--text);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.2px;
}
label:first-child { margin-top: 4px; }

/* Input wrapper — icon prefix + (opsiyonel) password toggle suffix
   .field block-level container; input width:100% + box-sizing:border-box
   ile padding'ler genişlik içine sayılır. Toggle absolute pozisyonda,
   field'ın sağ iç kenarına yapışır (input'un dışına taşmaz). */
.field {
  position: relative;
  display: block;
  width: 100%;
}
.field .ic-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: rgba(207, 226, 255, 0.45);
  pointer-events: none;
  z-index: 2;
  transition: color 0.15s;
}
.field .ic-prefix svg { width: 18px; height: 18px; display: block; }
.field:focus-within .ic-prefix { color: var(--accent); }

/* Field içindeki input'lar üzerine prefix/suffix padding ekle */
.field input {
  padding-left: 44px !important;
}
.field.has-suffix input {
  padding-right: 52px !important;     /* toggle 36 + 8 sağ + 8 nefes */
}

/* Şifre göster/gizle butonu — input'un içinde sağda
   Right: 8px input border'ından 8px içeri, button 36x36 input içinde rahat oturur. */
.field .pwd-toggle {
  position: absolute !important;
  right: 8px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  flex: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  outline: none !important;
  color: rgba(207, 226, 255, 0.65);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 3;
  font: inherit;
  line-height: 1;
  text-transform: none !important;
}
.field .pwd-toggle:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 213, 122, 0.30) !important;
  color: #ffd57a !important;
}
.field .pwd-toggle:focus,
.field .pwd-toggle:active {
  outline: none !important;
  box-shadow: none !important;
  transform: translateY(-50%) !important;
}
.field .pwd-toggle svg {
  width: 16px !important;
  height: 16px !important;
  display: block !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
}

input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;          /* universal * zaten verse de override garantisi */
  -webkit-appearance: none;        /* Chrome'un default input styling'i toggle pozisyonunu kaydırıyordu */
  appearance: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

input::placeholder { color: rgba(207, 226, 255, 0.32); }

input:hover  { border-color: rgba(255, 255, 255, 0.18); }
input:focus  {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.45);
  box-shadow:
    0 0 0 3px rgba(91, 141, 239, 0.18),
    0 0 22px rgba(91, 141, 239, 0.12);
}

button,
.full-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(180deg, var(--accent) 0%, #3a6cd6 100%);
  box-shadow:
    0 6px 20px rgba(91, 141, 239, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
}
button:hover,
.full-button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 8px 26px rgba(91, 141, 239, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}
button:active,
.full-button:active { transform: translateY(0); }

/* ===================== LINKS + NOTICES ===================== */

.auth-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.auth-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: color 0.15s;
}
.auth-links a:hover { color: var(--brand); }

.notice {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
}

.error {
  color: var(--error-fg);
  background: var(--error-bg);
  border: 1px solid rgba(232, 17, 35, 0.30);
}

.success {
  color: var(--ok-fg);
  background: var(--ok-bg);
  border: 1px solid rgba(108, 201, 90, 0.30);
}

/* ===================== ACCOUNT BOX (register sonrası) ===================== */

.account-box {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
}

.account-box span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.account-box strong {
  font-size: 20px;
  color: #fff;
  overflow-wrap: anywhere;
  font-weight: 600;
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 520px) {
  .auth-page { padding: 18px 12px; }
  .auth-card {
    padding: 24px 22px;
    border-radius: 16px;
  }
  h1 { font-size: 28px; }
  .auth-logo { width: min(220px, 70%); margin-bottom: 12px; }
}

@media (max-height: 720px) {
  .auth-page {
    align-items: start;
    padding-top: 18px;
    padding-bottom: 18px;
  }
  .auth-card {
    padding: 22px 28px;
    border-radius: 16px;
  }
  .auth-logo {
    width: min(220px, 65%);
    margin-bottom: 8px;
  }
  .auth-head span {
    margin-bottom: 6px;
    padding: 4px 12px;
    font-size: 10px;
  }
  h1 { font-size: 26px; }
  p  { margin-top: 6px; font-size: 13px; }
  .auth-form { margin-top: 14px; }
  label { margin: 10px 0 5px; }
  input  { height: 42px; }
  button,
  .full-button { min-height: 44px; margin-top: 14px; }
  .auth-links {
    margin-top: 14px;
    padding-top: 12px;
  }
}
