/* Auth Overlay Shell */
.auth-shell {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-stage {
  width: min(1100px, 100%);
  min-height: min(720px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(440px, 1fr);
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow-xl);
}

.auth-side {
  padding: 36px;
  display: grid;
  align-content: start;
  gap: 20px;
  background: var(--bg-deep);
  border-right: 1px solid var(--border);
}

.auth-side h1 {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-strong);
}

.auth-side-copy,
.auth-copy {
  color: var(--muted);
  line-height: 1.65;
}

.auth-feature-list {
  display: grid;
  gap: 10px;
}

.auth-feature-card {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.auth-feature-title {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: var(--text-strong);
}

.auth-feature-copy {
  color: var(--muted);
  font-size: 13.5px;
}

.auth-main {
  display: grid;
  place-items: center;
  padding: 36px;
  position: relative;
}

.auth-panel {
  width: min(460px, 100%);
  padding: 32px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow-md);
}

.auth-title {
  margin-top: 4px;
  font-size: clamp(26px, 2.5vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-strong);
}

.auth-copy {
  margin: 10px 0 18px;
}

.auth-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: var(--surface);
}

.auth-tab.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 600;
}

.auth-error {
  margin: 0 0 12px;
  color: var(--danger);
}

.auth-provider-button {
  width: 100%;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
}

.auth-provider-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.auth-provider-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.auth-divider {
  position: relative;
  margin: 0 0 16px;
  text-align: center;
}

.auth-divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px solid var(--border);
}

.auth-divider span {
  position: relative;
  display: inline-block;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bg);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.account-form {
  display: grid;
  gap: 12px;
}

.auth-form label,
.account-form label {
  display: grid;
  gap: 6px;
}

.auth-form span,
.account-form span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.auth-submit {
  margin-top: 4px;
}

.auth-close-button {
  position: absolute;
  top: 16px;
  right: 16px;
}

.account-summary {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-deep);
}

.account-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-strong);
}

@media (max-width: 1080px) {
  .auth-stage {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-side {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .auth-feature-list {
    display: none;
  }

  .auth-side h1 {
    font-size: 28px;
  }

  .auth-main {
    padding: 24px;
  }
}

@media (max-width: 720px) {
  .auth-shell {
    padding: 0;
    align-items: stretch;
  }

  .auth-stage {
    min-height: 100dvh;
    border-radius: 0;
    border: none;
    overflow-y: auto;
  }

  .auth-side {
    padding: 20px 16px;
    gap: 10px;
  }

  .auth-side h1 {
    font-size: 24px;
  }

  .auth-side-copy {
    font-size: 14px;
    line-height: 1.5;
  }

  .auth-side .brand-block {
    gap: 12px;
  }

  .auth-side .brand-logo {
    width: 40px;
    height: 40px;
    padding: 6px;
    border-radius: 10px;
  }

  .auth-main {
    padding: 16px;
    place-items: stretch;
  }

  .auth-panel {
    width: 100%;
    padding: 20px 16px;
    border-radius: 14px;
  }

  .auth-title {
    font-size: 24px;
  }

  .auth-copy {
    margin: 8px 0 12px;
    font-size: 14px;
  }

  .auth-tabs {
    width: 100%;
    margin-bottom: 12px;
  }

  .auth-form label,
  .account-form label {
    gap: 5px;
  }

  .auth-form input,
  .auth-form textarea,
  .account-form input,
  .account-form textarea {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 16px;
  }

  .auth-close-button {
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    font-size: 13px;
    z-index: 10;
  }

  .account-summary {
    padding: 10px 12px;
    border-radius: 10px;
  }

  .account-summary strong {
    font-size: 14px;
  }

  .profile-actions {
    margin-top: 14px;
    gap: 8px;
  }
}

/* Utilities like Toasts & Dialogs */
.toast-region {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 300;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slideFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text);
}

.toast[data-kind="error"] {
  border-color: rgba(245, 101, 101, 0.3);
  background: rgba(245, 101, 101, 0.04);
}

.toast[data-kind="success"] {
  border-color: rgba(72, 187, 120, 0.3);
  background: rgba(72, 187, 120, 0.04);
}

@media (max-width: 720px) {
  .toast-region {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toast {
    max-width: none;
  }
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
}

.confirm-dialog {
  width: min(400px, 100%);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow-xl);
}

.confirm-dialog h3 {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.confirm-dialog p {
  color: var(--muted);
  line-height: 1.6;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
