/* ============================================
   auth.css — Shared authentication styles
   Design language matches login.css
   ============================================ */

/* === Step Progress Indicator === */
.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  padding: 0 20px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: default;
  position: relative;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  border: 2px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
  transition: all 0.3s ease;
  position: relative;
}

.step-circle .step-check {
  width: 18px;
  height: 18px;
  display: none;
}

.step-item.active .step-circle {
  border-color: var(--royal);
  background: var(--royal);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
}

.step-item.completed .step-circle {
  border-color: var(--emerald);
  background: var(--emerald);
  color: transparent;
}

.step-item.completed .step-circle span { display: none; }
.step-item.completed .step-circle .step-check { display: block; }

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.3s ease;
  white-space: nowrap;
}

.step-item.active .step-label { color: var(--royal); }
.step-item.completed .step-label { color: var(--emerald); }

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 12px;
  margin-bottom: 28px;
  border-radius: 2px;
  overflow: hidden;
}

.step-line-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--royal));
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* === Multi-Step Forms === */
.step-form { display: none; }
.step-form.active { display: block; animation: stepIn 0.35s ease; }

@keyframes stepIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.step-buttons {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.step-buttons .af-btn { flex: 1; }

/* === Password Strength === */
.password-strength {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pw-strength-bar {
  flex: 1;
  height: 4px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}

.pw-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: var(--gray-300);
  transition: width 0.3s ease, background 0.3s ease;
}

.pw-strength-text {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 100px;
  text-align: right;
}

/* === Forgot Password === */
.af-field-help {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.4;
}

.af-input-error {
  border-color: var(--red-500) !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1) !important;
}

.af-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--red-50);
  border: 1px solid var(--red-100);
  border-radius: var(--radius-sm);
  color: var(--red-500);
  font-size: 13px;
  margin-bottom: 18px;
  animation: slideDown 0.3s ease;
}

.af-error .alert-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.back-to-login-wrap {
  text-align: center;
  margin-top: 20px;
}

.back-to-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-to-login svg {
  width: 16px;
  height: 16px;
}

.back-to-login:hover { color: var(--royal); }

.back-to-login-center {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.forgot-security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
}

.forgot-security-note svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* === Forgot Password — Success State === */
.forgot-success {
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.success-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.success-envelope {
  width: 80px;
  height: 80px;
  color: var(--royal);
  opacity: 0.2;
}

.success-check {
  position: absolute;
  width: 36px;
  height: 36px;
  background: var(--emerald);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
  bottom: -4px;
  right: -8px;
  animation: fadeIn 0.4s ease 0.2s both;
}

.success-check svg {
  width: 18px;
  height: 18px;
}

.success-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.success-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.success-text strong { color: var(--text); font-weight: 600; }

.success-tips {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.success-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--gray-50);
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: var(--text-secondary);
  text-align: left;
}

.success-tip svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}

/* === Section Title for Company Registration === */
.af-section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  margin-top: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.af-section-title:first-child { margin-top: 0; }

/* === 2-column form row === */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* === Select Input styling === */
.af-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  cursor: pointer;
  background: var(--surface);
}

.af-select-arrow {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

/* === Inline links within checkboxes === */
.af-inline-link {
  color: var(--royal);
  text-decoration: none;
  font-weight: 600;
}

.af-inline-link:hover {
  text-decoration: underline;
  color: var(--royal-dark);
}

/* === Checkbox error state === */
.af-checkbox-error .af-checkbox-mark {
  border-color: var(--red-500);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

/* === Sign In link below divider === */
.auth-signin-link {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.auth-signin-link a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--royal);
  text-decoration: none;
  transition: color 0.2s;
  padding: 10px 20px;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--border);
  width: 100%;
  justify-content: center;
}

.auth-signin-link a svg {
  width: 18px;
  height: 18px;
}

.auth-signin-link a:hover {
  background: var(--blue-50);
  border-color: var(--royal);
}

/* === Optional label === */
.af-label-optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 12px;
}

/* === Responsive === */
@media (max-width: 1100px) {
  .form-row-2 { gap: 12px; }
  .step-progress { padding: 0 12px; }
}

@media (max-width: 900px) {
  .step-progress { padding: 0 4px; }
  .step-circle { width: 36px; height: 36px; font-size: 13px; }
  .step-label { font-size: 11px; }
  .step-line { margin: 0 8px; margin-bottom: 26px; }
}

@media (max-width: 600px) {
  .form-row-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .step-circle { width: 32px; height: 32px; font-size: 12px; }
  .step-label { display: none; }
  .step-line { margin: 0 6px; margin-bottom: 24px; }
  .step-buttons { flex-direction: column; }
  .success-envelope { width: 64px; height: 64px; }
  .success-check { width: 30px; height: 30px; }
  .success-check svg { width: 14px; height: 14px; }
  .success-title { font-size: 20px; }
  .pw-strength-text { min-width: 70px; font-size: 10px; }
}
