/* ================================================================
   GMET — Auth & Registration Styles
   Login, Register, Verify, Forgot Password pages
   ================================================================ */

.auth-body {
  background: var(--off-white);
  min-height: 100vh;
}

.auth-header {
  background: var(--navy);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
}

.auth-main {
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 3rem;
}

/* ── Register Container ─── */
.register-container {
  width: 100%;
  max-width: 680px;
  position: relative;
}

/* ── Progress Bar ─── */
.progress-bar-container { 
  margin-bottom: 2rem; 
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  min-width: 300px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-400);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.progress-step.active .step-num {
  background: var(--gradient-blue);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(26,86,219,0.3);
}

.progress-step.completed .step-num {
  background: var(--success);
  color: var(--white);
}

.step-label {
  font-size: 0.65rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  text-align: center;
}

.progress-step.active .step-label { color: var(--royal-blue); }
.progress-step.completed .step-label { color: var(--success); }

@media (max-width: 600px) {
  .step-label {
    display: none;
  }
}

.progress-track {
  height: 4px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-blue);
  border-radius: 4px;
  transition: width 0.4s var(--ease-out);
}

/* ── Form Steps ─── */
.form-step {
  display: none;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  animation: fadeSlideUp 0.4s var(--ease-out);
}

.form-step.active { display: block; }

.step-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.step-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ── Form Grid ─── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 540px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-group.full { grid-column: 1 / -1; }
}

.form-group { display: flex; flex-direction: column; gap: 0.35rem; }

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.req { color: #ef4444; }

.form-group input,
.form-group textarea,
.form-group select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-100);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--white);
  transition: all 0.2s ease;
  width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--royal-blue);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.form-group input.error,
.form-group textarea.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.form-group input.valid {
  border-color: var(--success);
}

.field-error {
  font-size: 0.78rem;
  color: #ef4444;
  min-height: 1rem;
}

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

.password-wrapper input { padding-right: 3rem; }

.toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0.5;
}

.password-strength {
  height: 4px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.strength-text {
  font-size: 0.75rem;
  font-weight: 500;
}

/* ── File Upload ─── */
.file-upload-zone {
  position: relative;
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--off-white);
}

.file-upload-zone:hover { border-color: var(--royal-blue); background: rgba(26,86,219,0.04); }
.file-upload-zone.has-file { border-color: var(--success); border-style: solid; background: rgba(16,185,129,0.04); }

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  border: none !important;
  margin: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.file-upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-400);
  font-size: 0.85rem;
  pointer-events: none;
}

.file-icon { font-size: 1.5rem; }

.file-preview {
  display: none;
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 600;
  margin-top: 0.5rem;
}

.file-upload-zone.has-file .file-upload-content { display: none; }
.file-upload-zone.has-file .file-preview { display: block; }

/* ── OTP ─── */
.otp-container { text-align: center; padding: 1rem 0; }

.otp-inputs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.otp-digit {
  width: 48px;
  height: 56px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--royal-blue);
  transition: all 0.2s ease;
}

.otp-digit:focus {
  outline: none;
  border-color: var(--royal-blue);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.15);
}

.otp-timer {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--royal-blue);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.btn-link:disabled { opacity: 0.4; cursor: not-allowed; text-decoration: none; }

/* ── Review Summary ─── */
.review-summary {
  display: grid;
  gap: 0.75rem;
}

.review-section {
  background: var(--off-white);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--royal-blue);
}

.review-section h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--royal-blue);
  margin-bottom: 0.5rem;
}

.review-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.review-row:last-child { border-bottom: none; }
.review-label { color: var(--text-secondary); }
.review-value { font-weight: 600; color: var(--text-primary); text-align: right; }

/* ── Checkbox ─── */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--royal-blue);
}

.checkbox-label a { color: var(--royal-blue); text-decoration: underline; }

/* ── Step Actions ─── */
.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  gap: 1rem;
}

/* ── Loading Overlay ─── */
.loading-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.95);
  border-radius: var(--radius-lg);
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.loading-overlay.active { display: flex; }

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-100);
  border-top-color: var(--royal-blue);
  border-radius: 50%;
  animation: spin-slow 0.8s linear infinite;
}

/* ── Login Page ─── */
.login-container {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-md);
}

.login-container h2 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.login-container .step-desc { text-align: center; }

.login-container .form-group { margin-bottom: 1rem; }

.login-links {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-top: 1rem;
}

.login-links a { color: var(--royal-blue); font-weight: 500; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ---------- Mobile Responsive Overrides ---------- */
@media (max-width: 540px) {
  .auth-main {
    padding: 0.75rem 0.5rem 2rem !important;
  }
  .form-step, .login-container {
    padding: 1.25rem 1rem !important;
    border-radius: var(--radius-md) !important;
  }
  .step-title {
    font-size: 1.25rem !important;
  }
  .step-desc {
    font-size: 0.85rem !important;
    margin-bottom: 1.25rem !important;
  }
  .file-upload-zone {
    padding: 1.25rem 0.75rem !important;
  }
  .step-actions {
    flex-direction: column-reverse !important;
    gap: 0.75rem !important;
    margin-top: 1.25rem !important;
  }
  .step-actions .btn {
    width: 100% !important;
    margin: 0 !important;
    white-space: normal !important;
    font-size: 0.95rem !important;
    padding: 0.75rem 1.5rem !important;
    height: auto !important;
    min-height: 44px !important;
  }
  .btn-lg {
    padding: 0.875rem 2rem !important;
    font-size: 1rem !important;
  }
}
