/* ═══════════════════════════════════════════════
   DiagnosKit — Auth Modal
   ═══════════════════════════════════════════════ */

.auth-modal {
  max-width: 460px;
}

.auth-modal-header {
  padding: var(--space-8) var(--space-8) var(--space-6);
  text-align: center;
  position: relative;
}

.auth-modal-close {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--gray-500);
  transition: all var(--duration-fast);
  cursor: pointer;
}

.auth-modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.auth-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-blue);
}

.auth-logo-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.025em;
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.5;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-100);
  padding: 0 var(--space-8);
  gap: 0;
}

.auth-tab {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  text-align: center;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--duration-fast);
}

.auth-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.auth-tab:hover:not(.active) {
  color: var(--gray-700);
}

.auth-body {
  padding: var(--space-6) var(--space-8) var(--space-8);
}

/* ── Tab Panels ── */
.auth-panel {
  display: none;
  flex-direction: column;
  gap: var(--space-5);
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

.auth-panel.active {
  display: flex;
}

/* ── OAuth Row ── */
.oauth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

/* ── Password toggle ── */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast);
}

.password-toggle:hover {
  color: var(--gray-900);
}

/* ── Forgot / links ── */
.auth-link {
  font-size: 13px;
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--duration-fast);
}

.auth-link:hover {
  color: var(--blue-dark);
  text-decoration: underline;
}

.auth-forgot {
  text-align: right;
  margin-top: -var(--space-3);
}

/* ── Submit button ── */
.auth-submit {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 15px;
  position: relative;
}

.auth-submit .spinner {
  position: absolute;
  right: 16px;
}

/* ── Profile info (row 2 cols) ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

/* ── Register notice ── */
.auth-notice {
  background: var(--blue-light);
  border: 1px solid var(--blue-mid);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--blue-dark);
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  line-height: 1.5;
}

.auth-notice svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Terms ── */
.auth-terms {
  font-size: 12px;
  color: var(--gray-500);
  text-align: center;
  line-height: 1.5;
}

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

/* ── Success State ── */
.auth-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-4);
  padding: var(--space-8) 0;
  animation: fadeUp var(--duration-normal) var(--ease-out);
}

.auth-success-icon {
  width: 64px;
  height: 64px;
  background: var(--green-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
}

.auth-success-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--gray-900);
}

.auth-success-text {
  font-size: 14px;
  color: var(--gray-500);
  max-width: 280px;
  line-height: 1.6;
}

/* ── Forgot password panel ── */
.auth-back {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  margin-bottom: var(--space-4);
  transition: color var(--duration-fast);
  width: fit-content;
}

.auth-back:hover {
  color: var(--gray-900);
}

@media (max-width: 480px) {
  .auth-modal-header { padding: var(--space-6) var(--space-5) var(--space-4); }
  .auth-body         { padding: var(--space-5) var(--space-5) var(--space-6); }
  .auth-tabs         { padding: 0 var(--space-5); }
  .oauth-row         { grid-template-columns: 1fr; }
  .form-row          { grid-template-columns: 1fr; }
}
