:root {
  --mah-primary: #1e5e3a;
  --mah-primary-hover: #16462b;
  --mah-primary-light: #f0f7f3;
  --mah-accent: #2e7d32;
  --mah-dark: #19201d;
  --mah-muted: #64748b;
  --mah-border: #e2e8f0;
  --mah-surface: #ffffff;
  --mah-bg: #f8fafc;
  --mah-radius: 12px;
  --mah-shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --mah-shadow-md: 0 4px 18px rgba(0,0,0,0.08);
}

.mah-app-wrapper {
  max-width: 960px;
  margin: 30px auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--mah-dark);
}

/* Card Container */
.mah-card {
  background: var(--mah-surface);
  border-radius: var(--mah-radius);
  border: 1px solid var(--mah-border);
  box-shadow: var(--mah-shadow-md);
  padding: 32px 40px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .mah-card { padding: 20px 18px; }
}

/* Form Stepper / Navigation */
.mah-stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
  position: relative;
  counter-reset: step;
}

.mah-stepper::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 30px;
  right: 30px;
  height: 2px;
  background: var(--mah-border);
  z-index: 1;
}

.mah-step {
  position: relative;
  z-index: 2;
  background: var(--mah-surface);
  padding: 0 10px;
  text-align: center;
  cursor: pointer;
}

.mah-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--mah-surface);
  border: 2px solid var(--mah-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--mah-muted);
  transition: all 0.2s ease;
}

.mah-step.active .mah-step-circle {
  border-color: var(--mah-primary);
  background: var(--mah-primary);
  color: #fff;
}

.mah-step.completed .mah-step-circle {
  border-color: var(--mah-primary);
  background: var(--mah-primary-light);
  color: var(--mah-primary);
}

.mah-step-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--mah-muted);
}

.mah-step.active .mah-step-title {
  color: var(--mah-primary);
  font-weight: 700;
}

/* Form Layout */
.mah-form-section {
  display: none;
}
.mah-form-section.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mah-section-heading {
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--mah-border);
}

.mah-section-heading h3 {
  margin: 0 0 6px 0;
  font-size: 20px;
  color: var(--mah-primary);
}

.mah-section-heading p {
  margin: 0;
  font-size: 14px;
  color: var(--mah-muted);
}

.mah-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  .mah-grid { grid-template-columns: 1fr; }
}

/* Floating Input Controls */
.mah-row {
  margin-bottom: 18px;
}

.mah-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #334155;
}

.mah-row input[type=text],
.mah-row input[type=email],
.mah-row input[type=tel],
.mah-row input[type=date],
.mah-row input[type=password],
.mah-row input[type=number],
.mah-row select,
.mah-row textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  font-size: 14px;
  border: 1.5px solid var(--mah-border);
  border-radius: 8px;
  background: #fafbfc;
  color: var(--mah-dark);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mah-row input:focus,
.mah-row select:focus,
.mah-row textarea:focus {
  outline: none;
  border-color: var(--mah-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30, 94, 58, 0.12);
}

/* Image Upload with Live Preview */
.mah-upload-box {
  border: 2px dashed var(--mah-border);
  border-radius: var(--mah-radius);
  padding: 24px;
  text-align: center;
  background: var(--mah-bg);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}
.mah-upload-box:hover {
  border-color: var(--mah-primary);
  background: var(--mah-primary-light);
}

.mah-avatar-preview {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  margin: 0 auto 12px;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: var(--mah-shadow-sm);
  display: none;
}

/* Action Controls */
.mah-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--mah-border);
}

.mah-btn {
  background: var(--mah-primary);
  color: #fff;
  border: none;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}
.mah-btn:hover { background: var(--mah-primary-hover); }

.mah-btn-secondary {
  background: #e2e8f0;
  color: #334155;
}
.mah-btn-secondary:hover { background: #cbd5e1; }

/* Dashboard Metric Cards */
.mah-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.mah-metric-card {
  background: #fff;
  padding: 20px;
  border-radius: var(--mah-radius);
  border: 1px solid var(--mah-border);
  box-shadow: var(--mah-shadow-sm);
}
.mah-metric-label {
  font-size: 13px;
  color: var(--mah-muted);
  margin-bottom: 6px;
}
.mah-metric-val {
  font-size: 26px;
  font-weight: 700;
  color: var(--mah-primary);
}

/* Mobile OTP verification box */
.mah-otp-box {
  margin-top: 10px;
  padding: 12px 14px;
  background: #F7F4EC;
  border: 1.5px dashed #ded8c8;
  border-radius: 8px;
}
.mah-otp-box.is-invalid { border-color: #c0392b; background: #fff8f8; }
.mah-otp-box.is-verified { border-style: solid; border-color: #284905; background: #ffffff; }
.mah-otp-btn {
  background: #284905;
  color: #F7F4EC;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.mah-otp-btn:hover:not(:disabled) { background: #1F3A04; }
.mah-otp-btn:disabled { opacity: .6; cursor: not-allowed; }
.mah-otp-entry { display: flex; gap: 8px; margin-top: 10px; align-items: stretch; }
.mah-otp-code { letter-spacing: 4px; font-weight: 700; text-align: center; max-width: 170px; }
.mah-otp-status { font-size: 12px; margin-top: 8px; color: #6a7362; font-weight: 600; }
.mah-otp-status.ok { color: #284905; }
.mah-otp-status.err { color: #c0392b; }
.mah-otp-status.info { color: #1F3A04; }
