/* ============================================================
   Aotori – Auth Page (Giriş / Kayıt) — Two-column split
   ============================================================ */

/* ── Page shell ──────────────────────────────────────────── */
.ao-auth-page {
  position: relative;
  min-height: calc(100vh - var(--ao-header-height, 64px));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px 60px;
  overflow: hidden;
}

/* ── Decorative background orbs ─────────────────────────── */
.ao-auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.ao-auth-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
}

.ao-auth-bg__orb--1 {
  width: 480px;
  height: 480px;
  background: var(--ao-primary, #6c5ce7);
  top: -120px;
  left: -140px;
  animation: ao-auth-orb-drift 14s ease-in-out infinite alternate;
}

.ao-auth-bg__orb--2 {
  width: 380px;
  height: 380px;
  background: #6366f1;
  bottom: -100px;
  right: -100px;
  animation: ao-auth-orb-drift 18s ease-in-out infinite alternate-reverse;
}

.ao-auth-bg__orb--3 {
  width: 260px;
  height: 260px;
  background: #a78bfa;
  top: 50%;
  left: 55%;
  opacity: 0.1;
  animation: ao-auth-orb-drift 22s ease-in-out infinite alternate;
}

@keyframes ao-auth-orb-drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(30px, 20px) scale(1.08);
  }
}

/* ── Main wrapper (2-column grid) ───────────────────────── */
.ao-auth-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: 1fr 400px;
  min-height: 580px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  animation: ao-auth-card-in 0.45s ease both;
}

@keyframes ao-auth-card-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Forms side (left) ───────────────────────────────────── */
.ao-auth-forao-side {
  background: var(--ao-bg-card, #1e1e2e);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 36px 36px 28px;
  /* clip-path clips box-shadows that overflow:hidden misses */
  clip-path: inset(0);
}

/* ── Brand ───────────────────────────────────────────────── */
.ao-auth-brand {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.ao-auth-brand__logo img {
  max-height: 44px;
  width: auto;
}

.ao-auth-brand__logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--ao-primary, #6c5ce7), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

/* ── Status bar ──────────────────────────────────────────── */
.ao-auth-status {
  border-radius: 10px;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    padding 0.3s ease,
    margin 0.3s ease;
}

.ao-auth-status.is-error {
  max-height: 80px;
  padding: 11px 14px;
  margin-bottom: 14px;
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.28);
  color: #e74c3c;
}

.ao-auth-status.is-success {
  max-height: 80px;
  padding: 11px 14px;
  margin-bottom: 14px;
  background: rgba(39, 174, 96, 0.12);
  border: 1px solid rgba(39, 174, 96, 0.28);
  color: #27ae60;
}

/* ── Panels carousel clip (flex col item that clips horizontally) */
.ao-auth-panels-clip {
  flex: 1;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  /* overflow:hidden doesn't clip box-shadows; clip-path does */
  clip-path: inset(0);
}

/* ── Panels carousel wrap ────────────────────────────────── */
.ao-auth-panels-wrap {
  display: flex;
  width: 300%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.77, 0, 0.18, 1);
}

.ao-auth-wrapper[data-active="register"] .ao-auth-panels-wrap {
  transform: translateX(-33.333%);
}

.ao-auth-wrapper[data-active="forgot"] .ao-auth-panels-wrap {
  transform: translateX(-66.666%);
}

/* ── Individual panel ────────────────────────────────────── */
.ao-auth-panel {
  width: 33.333%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* suppress box-shadows from children bleeding out */
}

/* Kill all box-shadows inside off-screen panels */
.ao-auth-wrapper[data-active="login"] .ao-auth-panel[data-tab="register"] *,
.ao-auth-wrapper[data-active="login"] .ao-auth-panel[data-tab="forgot"] *,
.ao-auth-wrapper[data-active="register"] .ao-auth-panel[data-tab="login"] *,
.ao-auth-wrapper[data-active="register"] .ao-auth-panel[data-tab="forgot"] *,
.ao-auth-wrapper[data-active="forgot"] .ao-auth-panel[data-tab="login"] *,
.ao-auth-wrapper[data-active="forgot"] .ao-auth-panel[data-tab="register"] * {
  box-shadow: none !important;
}

.ao-auth-panel__title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ao-text, #e0e0e0);
  margin: 0 0 4px;
  line-height: 1.2;
}

.ao-auth-panel__sub {
  font-size: 0.85rem;
  color: var(--ao-text-muted, #606080);
  margin: 0 0 22px;
}

/* ── Illustration side (right) ───────────────────────────── */
.ao-auth-illus-side {
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.ao-auth-illus-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 28px;
  text-align: center;
  opacity: 0;
  transform: scale(1.04) translateX(12px);
  transition:
    opacity 0.5s ease,
    transform 0.5s cubic-bezier(0.77, 0, 0.18, 1);
  pointer-events: none;
}

/* Login panel: teal gradient */
.ao-auth-illus-panel[data-for="login"] {
  background: linear-gradient(145deg, #0f766e, #0e7490, #1d4ed8);
}

/* Register panel: purple gradient */
.ao-auth-illus-panel[data-for="register"] {
  background: linear-gradient(145deg, #6d28d9, #7c3aed, #a21caf);
}

/* Forgot panel: blue-pink gradient */
.ao-auth-illus-panel[data-for="forgot"] {
  background: linear-gradient(145deg, #0369a1, #7c3aed, #be185d);
}

/* Active state */
.ao-auth-wrapper[data-active="login"] .ao-auth-illus-panel[data-for="login"],
.ao-auth-wrapper[data-active="register"] .ao-auth-illus-panel[data-for="register"],
.ao-auth-wrapper[data-active="forgot"] .ao-auth-illus-panel[data-for="forgot"] {
  opacity: 1;
  transform: scale(1) translateX(0);
  pointer-events: auto;
}

/* Forgot panel icon */
.ao-auth-illus-forgot-icon {
  position: relative;
  z-index: 1;
  width: 96px;
  height: 96px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ao-auth-float 4s ease-in-out infinite;
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.3));
}

/* Decorative blobs */
.ao-auth-illus-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.25;
  pointer-events: none;
}

.ao-auth-illus-blob--1 {
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.35);
  top: -60px;
  right: -60px;
}

.ao-auth-illus-blob--2 {
  width: 160px;
  height: 160px;
  background: rgba(255, 255, 255, 0.2);
  bottom: -40px;
  left: -40px;
}

/* Character art */
.ao-auth-illus-art {
  position: relative;
  z-index: 1;
  width: 200px;
  height: 240px;
  margin-bottom: 20px;
  animation: ao-auth-float 4s ease-in-out infinite;
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.3));
}

.ao-auth-illus-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom;
}

@keyframes ao-auth-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.ao-auth-illus-title {
  position: relative;
  z-index: 1;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ao-auth-illus-desc {
  position: relative;
  z-index: 1;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 24px;
  line-height: 1.5;
}

.ao-auth-illus-btn {
  position: relative;
  z-index: 1;
  padding: 11px 28px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50px;
  background: transparent;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.15s;
  letter-spacing: 0.02em;
}

.ao-auth-illus-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #fff;
  transform: translateY(-2px);
}

/* ── Social auth ──────────────────────────────────────────── */
.ao-auth-social {
  margin: 16px 0 0;
}

.ao-auth-social__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--ao-text-muted, #606080);
  font-size: 0.78rem;
}

.ao-auth-social__divider::before,
.ao-auth-social__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ao-border, rgba(255, 255, 255, 0.1));
}

.ao-auth-social__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ao-auth-social__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--ao-border, rgba(255, 255, 255, 0.1));
  background: var(--ao-bg-alt, rgba(255, 255, 255, 0.05));
  color: var(--ao-text, #e0e0e0);
  cursor: pointer;
  transition:
    transform 0.15s,
    border-color 0.2s,
    background 0.2s;
}

.ao-auth-social__btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.ao-auth-social__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ao-auth-social__btn--google {
  border-color: rgba(66, 133, 244, 0.45);
}
.ao-auth-social__btn--discord {
  border-color: rgba(88, 101, 242, 0.45);
}
.ao-auth-social__btn--x {
  border-color: rgba(255, 255, 255, 0.25);
}

/* ── Form ────────────────────────────────────────────────── */
.ao-auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Field ───────────────────────────────────────────────── */
.ao-auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ao-auth-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ao-text-light, #a0a0b0);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ao-auth-label svg {
  color: var(--ao-primary, #6c5ce7);
  flex-shrink: 0;
}

.ao-auth-input {
  width: 100%;
  padding: 11px 13px;
  background: var(--ao-bg-alt, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--ao-border, rgba(255, 255, 255, 0.1));
  border-radius: 10px;
  color: var(--ao-text, #e0e0e0);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
  box-sizing: border-box;
}

.ao-auth-input::placeholder {
  color: var(--ao-text-muted, #606080);
}

.ao-auth-input:focus {
  border-color: var(--ao-primary, #6c5ce7);
  background: color-mix(
    in srgb,
    var(--ao-primary, #6c5ce7) 6%,
    var(--ao-bg-alt, #2a2a3e)
  );
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--ao-primary, #6c5ce7) 18%, transparent);
}

.ao-auth-input.is-invalid {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.14);
}

.ao-auth-hint {
  font-size: 0.78rem;
  color: var(--ao-text-muted, #606080);
  margin-top: 2px;
}

/* ── Password visibility toggle ─────────────────────────── */
.ao-auth-pass-wrap {
  position: relative;
}

.ao-auth-pass-wrap .ao-auth-input {
  padding-right: 44px;
}

.ao-auth-pass-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ao-text-muted, #606080);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.ao-auth-pass-toggle:hover {
  color: var(--ao-primary, #6c5ce7);
}

/* ── Password strength ───────────────────────────────────── */
.ao-auth-strength {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.25s;
}

.ao-auth-strength.is-visible {
  opacity: 1;
}

.ao-auth-strength__bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--ao-border, rgba(255, 255, 255, 0.1));
  overflow: hidden;
}

.ao-auth-strength__fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  transition:
    width 0.35s ease,
    background 0.35s ease;
  width: 0;
}

.ao-auth-strength__fill--weak {
  background: #e74c3c;
  width: 25%;
}
.ao-auth-strength__fill--fair {
  background: #f39c12;
  width: 50%;
}
.ao-auth-strength__fill--good {
  background: #3498db;
  width: 75%;
}
.ao-auth-strength__fill--strong {
  background: #27ae60;
  width: 100%;
}

.ao-auth-strength__label {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 44px;
}

/* ── Remember me + forgot link row ──────────────────────── */
.ao-auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ao-auth-check {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--ao-text-light, #a0a0b0);
  user-select: none;
}

.ao-auth-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ao-primary, #6c5ce7);
  cursor: pointer;
  border-radius: 4px;
}

.ao-auth-link {
  font-size: 0.85rem;
  color: var(--ao-primary, #6c5ce7);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: color 0.15s;
}

.ao-auth-link:hover {
  color: var(--ao-primary-hover, #5a4bd1);
  text-decoration: underline;
}

/* ── Submit button ───────────────────────────────────────── */
.ao-auth-submit {
  width: 80%;
  padding: 13px;
  background: linear-gradient(135deg, var(--ao-primary, #6c5ce7), #6366f1);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.97rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    opacity 0.2s,
    transform 0.15s,
    box-shadow 0.2s;
  box-shadow: 0 4px 18px rgba(108, 92, 231, 0.38);
  margin: auto;
}

.ao-auth-submit:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(108, 92, 231, 0.5);
}

.ao-auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.ao-auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ao-auth-submit__spinner {
  display: none;
  animation: ao-auth-spin 0.8s linear infinite;
  flex-shrink: 0;
}

.ao-auth-submit.is-loading .ao-auth-submit__label {
  opacity: 0.75;
}

.ao-auth-submit.is-loading .ao-auth-submit__spinner {
  display: block;
}

@keyframes ao-auth-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ── Switch tab prompt ───────────────────────────────────── */
.ao-auth-switch {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ao-text-muted, #606080);
  margin: 4px 0 0;
}

.ao-auth-switch-btn {
  background: none;
  border: none;
  color: var(--ao-primary, #6c5ce7);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.ao-auth-switch-btn:hover {
  color: var(--ao-primary-hover, #5a4bd1);
}

/* ── Registration closed message ─────────────────────────── */
.ao-auth-closed {
  text-align: center;
  color: var(--ao-text-muted, #606080);
  padding: 20px 0;
  margin: 0;
}

/* ── Debug output ────────────────────────────────────────── */
.ao-auth-debug {
  font-size: 0.72rem;
  color: var(--ao-text-muted, #606080);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px;
  margin-top: 12px;
}

/* ── Responsive: tablet ──────────────────────────────────── */
@media (max-width: 768px) {
  .ao-auth-wrapper {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    max-width: 480px;
    min-height: auto;
    border-radius: 20px;
  }

  /* Show illustration on top, collapsed */
  .ao-auth-illus-side {
    order: -1;
    height: 200px;
    position: relative;
  }

  .ao-auth-illus-panel {
    flex-direction: row;
    justify-content: space-around;
    padding: 20px 24px;
    text-align: left;
  }

  .ao-auth-illus-art {
    width: 120px;
    height: 120px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .ao-auth-illus-desc {
    display: none;
  }

  .ao-auth-illus-btn {
    display: none;
  }

  .ao-auth-forao-side {
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 28px 24px 24px;
  }

  .ao-auth-brand {
    margin-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .ao-auth-page {
    padding: 20px 12px 40px;
  }

  .ao-auth-forao-side {
    padding: 24px 20px 20px;
  }

  .ao-auth-bg__orb--1 {
    width: 280px;
    height: 280px;
  }
  .ao-auth-bg__orb--2 {
    width: 220px;
    height: 220px;
  }
  .ao-auth-bg__orb--3 {
    display: none;
  }
}
