/* Auth modal — kurumsal giriş / kayıt penceresi */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.auth-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.auth-modal[hidden] {
  display: none !important;
}

.auth-modal.is-open[hidden] {
  display: flex !important;
}

body.auth-modal-open {
  overflow: hidden;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(37, 99, 235, 0.18), transparent 55%),
    rgba(4, 7, 14, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}

.auth-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(92vh, 880px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(165deg, #0e1422 0%, #0a0e18 55%, #080b12 100%);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow:
    0 0 0 1px rgba(37, 99, 235, 0.08),
    0 28px 80px rgba(0, 0, 0, 0.55),
    0 8px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(18px) scale(0.98);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.auth-modal.is-open .auth-modal__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.auth-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  color: #cbd5e1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.auth-modal__close:hover {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(59, 130, 246, 0.45);
  color: #fff;
}

.auth-modal__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.auth-modal__brand {
  position: relative;
  padding: 2.25rem 1.85rem 2rem;
  background:
    linear-gradient(160deg, rgba(37, 99, 235, 0.22) 0%, transparent 42%),
    linear-gradient(200deg, #0b1220 0%, #071018 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.auth-modal__brand-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  right: -60px;
  bottom: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.35), transparent 68%);
  pointer-events: none;
}

.auth-modal__logo {
  display: inline-flex;
  margin-bottom: 1.75rem;
  position: relative;
  z-index: 1;
}

.auth-modal__logo img {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.auth-modal__brand-kicker {
  position: relative;
  z-index: 1;
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #93c5fd;
}

.auth-modal__brand-title {
  position: relative;
  z-index: 1;
  margin: 0 0 0.75rem;
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  font-size: clamp(1.35rem, 2.2vw, 1.65rem);
  font-weight: 750;
  line-height: 1.25;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}

.auth-modal__brand-text {
  position: relative;
  z-index: 1;
  margin: 0 0 1.75rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #94a3b8;
  max-width: 28ch;
}

.auth-modal__perks {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-modal__perks li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.84rem;
  color: #cbd5e1;
  font-weight: 500;
}

.auth-modal__perk-ico {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(37, 99, 235, 0.16);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.auth-modal__main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(8, 11, 18, 0.55);
}

.auth-modal__tabs {
  display: flex;
  gap: 0.35rem;
  padding: 1.15rem 1.5rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.auth-modal__tab {
  position: relative;
  flex: 1;
  padding: 0.7rem 0.85rem 0.85rem;
  border: 0;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  transition: color 0.15s;
}

.auth-modal__tab::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background 0.18s;
}

.auth-modal__tab:hover {
  color: #94a3b8;
}

.auth-modal__tab.is-active {
  color: #e2e8f0;
}

.auth-modal__tab.is-active::after {
  background: linear-gradient(90deg, #2563eb, #3b82f6);
}

.auth-modal__panels {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1.35rem 1.5rem 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.35) transparent;
}

.auth-modal__panel[hidden] {
  display: none !important;
}

.auth-modal__heading {
  margin: 0 0 0.35rem;
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.auth-modal__sub {
  margin: 0 0 1.15rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #94a3b8;
}

.auth-modal__alert {
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  border: 1px solid rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
}

.auth-modal__alert[hidden] {
  display: none !important;
}

.auth-modal__form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.auth-modal__form--register {
  gap: 1.15rem;
}

.auth-modal__section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.auth-modal__section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.auth-modal__section-title {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.auth-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.auth-modal__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.auth-modal__label {
  font-size: 0.74rem;
  font-weight: 600;
  color: #94a3b8;
}

.auth-modal__input,
.auth-modal__textarea {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 14, 0.55);
  color: #f1f5f9;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.auth-modal__textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.45;
}

.auth-modal__input::placeholder,
.auth-modal__textarea::placeholder {
  color: #475569;
}

.auth-modal__input:hover,
.auth-modal__textarea:hover {
  border-color: rgba(148, 163, 184, 0.28);
}

.auth-modal__input:focus,
.auth-modal__textarea:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  background: rgba(2, 6, 14, 0.75);
}

.auth-modal__submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.85rem 1.1rem;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #3b82f6 100%);
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.32);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.auth-modal__submit:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.4);
}

.auth-modal__submit:active:not(:disabled) {
  transform: translateY(1px);
}

.auth-modal__submit:disabled {
  opacity: 0.72;
  cursor: wait;
}

.auth-modal__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

.auth-modal__spinner[hidden] {
  display: none !important;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

.auth-modal__switch {
  margin: 1.1rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: #64748b;
}

.auth-modal__link {
  border: 0;
  background: none;
  padding: 0;
  color: #93c5fd;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-modal__link:hover {
  color: #bfdbfe;
}

@media (max-width: 820px) {
  .auth-modal__grid {
    grid-template-columns: 1fr;
  }

  .auth-modal__brand {
    display: none;
  }

  .auth-modal__dialog {
    max-height: min(94vh, 920px);
  }

  .auth-modal__panels {
    padding: 1.15rem 1.15rem 1.35rem;
  }

  .auth-modal__tabs {
    padding: 1rem 1.15rem 0;
  }
}

@media (max-width: 520px) {
  .auth-modal {
    padding: 0;
    align-items: stretch;
  }

  .auth-modal__dialog {
    width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .auth-modal__row {
    grid-template-columns: 1fr;
  }

  .auth-modal__close {
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
  }
}
