.unified-auth-wrapper {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 14, 0.85);
  backdrop-filter: blur(28px);
  padding: 24px;
}

.unified-auth-wrapper.active-popup {
  display: flex;
}

.unified-auth-wrapper .icon-close {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 20px;
  color: var(--color-text);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  z-index: 1000;
}

.unified-auth-card {
  width: min(960px, 100%);
  background: rgba(11, 15, 25, 0.95);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  backdrop-filter: blur(32px);
}

.auth-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 520px;
}

.auth-copy-panel {
  position: relative;
  background: radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.24), transparent 55%),
    radial-gradient(circle at 90% 0%, rgba(14, 165, 233, 0.18), transparent 45%),
    rgba(9, 12, 21, 0.95);
  padding: 48px 40px 32px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px 0 0 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  color: var(--color-text);
}

.auth-copy-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
  border-radius: 28px 0 0 28px;
}

.auth-copy-headline {
  font-size: 32px;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: none;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.35;
  font-family: "Segoe UI Variable Display", "Segoe UI", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-copy-line {
  display: block;
  font-size: 32px;
  letter-spacing: 0.2em;
  line-height: 1.2;
}

.auth-copy-label-logo {
  width: 160px;
  height: auto;
  filter: drop-shadow(0 8px 25px rgba(0, 0, 0, 0.35));
  margin-left: -25px;
}

.auth-copy-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
  max-width: 320px;
}

.auth-visual {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.auth-visual-pill {
  width: 72px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(94, 211, 255, 0.95), rgba(59, 130, 246, 0.95));
}

.auth-visual-note {
  margin: 0;
}

.auth-form-panel {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-footer-terms {
  margin-top: auto;
  font-size: 11px;
  color: var(--color-muted);
}

.auth-footer-terms a {
  color: var(--color-link);
  font-weight: 600;
}

.auth-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.auth-back-link {
  display: none;
  border: none;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}

.auth-back-link.visible {
  display: inline-flex;
}

.auth-back-link.inline {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

.auth-back-link.hidden {
  display: none !important;
}

.auth-back-link.inline {
  color: rgba(255, 255, 255, 0.72);
}

.auth-step-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--color-white);
}

.auth-step-description {
  font-size: 13px;
  color: var(--color-muted);
  margin: 4px 0 0;
}

.google-btn-slot {
  width: 100%;
}

.google-btn-slot.hidden {
  display: none;
}

.auth-divider.hidden {
  display: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 8px 0 0;
}

.auth-divider span {
  margin: 0 auto;
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--color-muted);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 12px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.auth-field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--color-muted);
}

.auth-form input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--color-background);
  color: var(--color-text);
  font-size: 14px;
  outline: none;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 48px;
  padding-left: 16px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--color-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 6px;
}

.password-toggle ion-icon {
  font-size: 18px;
}

.password-toggle:focus-visible {
  outline: 1px solid rgba(59, 130, 246, 0.8);
  border-radius: 50%;
}

.auth-form input:focus {
  border-color: rgba(59, 130, 246, 0.9);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.auth-step {
  display: none;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.auth-step.visible {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.unified-primary-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.95), rgba(37, 99, 235, 0.95));
  color: var(--color-white);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.unified-primary-btn.google {
  background: #fff;
  color: #111827;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: none;
}

.unified-primary-btn.google.disabled {
  background: #f3f4f6;
  color: #6b7280;
  border-color: rgba(148, 163, 184, 0.2);
  cursor: not-allowed;
}

.unified-primary-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.unified-primary-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
}

.auth-terms-text {
  font-size: 11px;
  color: var(--color-muted);
  margin: 0;
}

.auth-terms-text a {
  color: var(--color-link);
  font-weight: 600;
}

.auth-step-footer {
  display: flex;
  justify-content: flex-end;
}

.forgot-link {
  font-size: 12px;
  color: var(--color-link);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.forgot-link.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.password-hint.unified-hint {
  font-size: 12px;
  color: var(--color-muted);
  margin: 0;
}

.auth-error {
  min-height: 18px;
  font-size: 12px;
  color: var(--color-error);
  text-align: center;
  margin-top: 4px;
}

.auth-error.visible {
  color: var(--color-error);
}

.auth-error.success {
  color: #7dd3fc;
}

@media (max-width: 900px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .auth-copy-panel {
    display: none;
  }

  .auth-form-panel {
    padding: 28px;
  }

  .unified-auth-card {
    min-height: auto;
  }
}

@media (max-width: 520px) {
  .auth-form-panel {
    padding: 20px;
  }

  .auth-divider::before,
  .auth-divider::after {
    margin: 0 6px;
  }
}
