body.login-screen,
body.register-screen {
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.52), transparent 18%),
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.2), transparent 12%),
    radial-gradient(circle at 86% 22%, rgba(255, 255, 255, 0.14), transparent 10%),
    linear-gradient(180deg, #d8e1e9 0%, #b5c1cb 36%, #8f9aa5 68%, #73808c 100%);
}

body.login-screen::before,
body.login-screen::after,
body.register-screen::before,
body.register-screen::after {
  content: "";
  position: fixed;
  inset: -8%;
  pointer-events: none;
  z-index: 0;
}

body.login-screen::before,
body.register-screen::before {
  background:
    linear-gradient(90deg, rgba(248, 250, 252, 0.42) 0 9%, transparent 9% 20%, rgba(255, 255, 255, 0.14) 20% 28%, transparent 28% 72%, rgba(255, 255, 255, 0.1) 72% 80%, transparent 80% 100%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0.22));
  filter: blur(18px);
  transform: scale(1.06);
  opacity: 0.78;
}

body.login-screen::after,
body.register-screen::after {
  background:
    radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.16), transparent 26%),
    radial-gradient(circle at 18% 62%, rgba(15, 118, 110, 0.18), transparent 18%),
    radial-gradient(circle at 82% 64%, rgba(59, 130, 246, 0.2), transparent 18%);
  filter: blur(36px);
  opacity: 0.9;
}

body.login-screen .app-shell,
body.login-screen .app-main,
body.login-screen .view.active-view {
  position: relative;
  z-index: 1;
}

body.login-screen .topbar,
body.register-screen .topbar {
  display: none;
}

body.login-screen .app-main {
  width: 100%;
  margin: 0;
}

.login-view.active-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
}

.login-scene {
  width: min(100%, 430px);
  display: grid;
  justify-items: center;
  gap: 0.7rem;
}

.login-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}

.login-brand-text {
  width: 100%;
  display: flex;
  justify-content: center;
}

.login-brand-text p {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #004d39;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  text-align: center;
}

.portal-card {
  width: 100%;
  padding: 0;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(247, 250, 255, 0.62)),
    rgba(255, 255, 255, 0.48);
  box-shadow:
    0 24px 80px rgba(15, 23, 42, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 0 0 1px rgba(255, 255, 255, 0.25) inset;
  overflow: hidden;
}

.role-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
  padding: 0.35rem;
  margin: 0.5rem 0.5rem 0;
  border-radius: 16px;
  background: rgba(241, 245, 249, 0.85);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.role-tab {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.55rem 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 2.6rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.role-tab .tab-icon {
  width: 1.1rem;
  height: 1.1rem;
  display: inline-flex;
  transition: transform 0.2s ease;
}

.role-tab:hover .tab-icon {
  transform: scale(1.1);
}

.role-tab .tab-icon svg {
  width: 100%;
  height: 100%;
}

.role-tab.active {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: transparent;
  box-shadow:
    0 4px 12px rgba(16, 185, 129, 0.25),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.portal-body {
  padding: 0.9rem 1rem 0.95rem;
}

.portal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.portal-heading h2 {
  margin: 0;
  font-size: clamp(1.38rem, 3.3vw, 1.9rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #101828;
}

.flag-icon {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-top: 0.35rem;
  width: 1.55rem;
  border-radius: 0.2rem;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.flag-icon svg {
  display: block;
  width: 100%;
  height: auto;
}

.role-panel {
  display: grid;
  gap: 0.55rem;
}

.role-panel:not(.active),
.role-panel[hidden] {
  display: none !important;
}

.portal-form {
  display: grid;
  gap: 0.58rem;
}

.field-group label {
  margin-bottom: 0.28rem;
  font-size: 0.83rem;
  font-weight: 500;
  color: #101828;
  text-transform: none;
  letter-spacing: 0;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-shell input {
  padding-left: 2.75rem;
  padding-right: 3rem;
  height: 3.2rem;
  border-radius: 12px;
  border: 1.5px solid rgba(148, 163, 184, 0.25);
  background: rgba(248, 250, 252, 0.8);
  font-size: 0.95rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) inset;
}

.input-shell input::placeholder {
  color: rgba(100, 116, 139, 0.6);
}

.input-shell input:focus {
  border-color: var(--primary);
  background: var(--surface-strong);
  box-shadow:
    0 0 0 4px rgba(16, 185, 129, 0.15),
    0 1px 0 rgba(255, 255, 255, 0.92) inset;
}

.input-icon,
.input-action {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(71, 85, 105, 0.7);
  transition: color 0.2s ease;
}

.input-shell input:focus~.input-icon {
  color: var(--primary);
}

.input-icon {
  left: 0.95rem;
  width: 1.2rem;
  height: 1.2rem;
}

.input-icon svg,
.input-action svg {
  width: 100%;
  height: 100%;
}

.input-action {
  right: 0.75rem;
  width: 1.7rem;
  height: 1.7rem;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
}

.input-action:hover {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text);
}

.input-action .eye-off {
  display: none;
}

.input-action.is-revealed .eye-open {
  display: none;
}

.input-action.is-revealed .eye-off {
  display: block;
}

.password-shell input {
  padding-right: 3.25rem;
}

.login-note {
  margin-top: 0.1rem;
  margin-bottom: 0;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.portal-submit {
  width: 100%;
  min-height: 3.2rem;
  font-size: 0.95rem;
  justify-content: center;
  gap: 0.6rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow:
    0 10px 25px rgba(16, 185, 129, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.1) inset;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.portal-submit:hover {
  transform: translateY(-1px);
  box-shadow:
    0 12px 30px rgba(16, 185, 129, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.15) inset;
}

.portal-submit:active {
  transform: translateY(1px);
}

.portal-submit svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.portal-submit:disabled {
  opacity: 0.55;
  box-shadow: none;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border);
}

.login-stats .mini-stat {
  padding: 0.75rem 0.25rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.01);
  transition: all 0.2s ease;
}

.login-stats .mini-stat:hover {
  background: var(--surface-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.login-stats .mini-stat .k {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.login-stats .mini-stat .v {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

.portal-footer {
  display: grid;
  place-items: center;
  padding-top: 0.3rem;
}

.portal-footnote {
  font-size: 0.68rem;
  color: rgba(71, 85, 105, 0.8);
  letter-spacing: 0.02em;
}

@media (max-height: 760px) {
  .login-scene {
    gap: 0.55rem;
    transform: scale(0.94);
    transform-origin: top center;
  }

  .login-view.active-view {
    padding-top: 0.6rem;
  }
}

/* Biometric Registry & Verification Wizard Styling */
.wizard-container {
  margin-top: 1.5rem;
  padding: 2.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  background: var(--surface-strong);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.wizard-container input,
.wizard-container select {
  background: #ffffff !important;
  border: 1.5px solid rgba(148, 163, 184, 0.25) !important;
  border-radius: 10px !important;
  padding: 0.75rem 1rem !important;
  font-size: 0.9rem !important;
  color: var(--text) !important;
  transition: all 0.2s ease !important;
  min-height: 44px;
}

.wizard-container .input-shell input {
  padding-left: 2.75rem !important;
}

.wizard-container input:focus,
.wizard-container select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
  outline: none !important;
}

.wizard-container .file-label {
  cursor: pointer;
  padding: 2.5rem 2rem;
  border: 2px dashed rgba(16, 185, 129, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border-radius: 14px;
  background: #F8FAFC;
  transition: all 0.2s ease;
}

.wizard-container .file-label:hover {
  border-color: var(--primary) !important;
  background: rgba(16, 185, 129, 0.04) !important;
}

.wizard-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  gap: 1rem;
}

.wizard-step {
  font-size: 0.95rem;
  color: var(--text-faint);
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  padding-bottom: 0.5rem;
  cursor: default;
}

.wizard-step.active {
  color: var(--primary);
  font-weight: 700;
}

.wizard-step.active::after {
  content: "";
  position: absolute;
  bottom: -1rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 99px;
  animation: fadeSlide 0.3s ease;
}

/* Biometric Guideline Oval and Nodes */
.camera-face-guideline {
  position: absolute;
  inset: 15%;
  border: 2px dashed rgba(16, 185, 129, 0.6);
  border-radius: 50% / 60% 60% 40% 40%;
  pointer-events: none;
  z-index: 5;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.4);
  transition: all 0.3s ease;
}

.camera-face-guideline::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.8);
  box-shadow: 0 0 8px var(--success);
}

.camera-face-guideline.aligned {
  border: 3px solid #10b981 !important;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5), 0 0 0 9999px rgba(15, 23, 42, 0.35) !important;
}
.camera-face-guideline.aligned::before {
  background: #10b981 !important;
  box-shadow: 0 0 12px #10b981 !important;
}

.camera-face-guideline.misaligned {
  border: 2px dashed #f59e0b !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3), 0 0 0 9999px rgba(15, 23, 42, 0.45) !important;
}
.camera-face-guideline.misaligned::before {
  background: #f59e0b !important;
  box-shadow: 0 0 8px #f59e0b !important;
}

.camera-face-guideline.no-face {
  border: 2px dashed #ef4444 !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3), 0 0 0 9999px rgba(15, 23, 42, 0.5) !important;
}
.camera-face-guideline.no-face::before {
  background: #ef4444 !important;
  box-shadow: 0 0 8px #ef4444 !important;
}

.biometric-mesh-overlay {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(16, 185, 129, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(16, 185, 129, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.04) 1px, transparent 1px);
  background-size: 8px 8px, 20px 20px, 20px 20px;
  pointer-events: none;
  opacity: 0.7;
}

.biometric-scan-animation {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px double var(--primary);
  border-top-color: var(--success);
  border-bottom-color: var(--success);
  animation: spinRadar 1.8s linear infinite;
  position: relative;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.biometric-scan-animation::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 2px dashed var(--secondary);
  animation: spinRadar 3s linear infinite reverse;
}

.ocr-scanner-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--success), transparent);
  box-shadow: 0 0 12px var(--success), 0 0 4px var(--success);
  z-index: 10;
  animation: scanRadar 2.5s ease-in-out infinite;
}

#livenessChallengeContainer {
  border-radius: 12px;
  animation: fadeSlide 0.3s ease;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-grid.two-columns {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.form-grid.two-columns.align-center {
  align-items: center !important;
  gap: 1.5rem !important;
}

.form-grid.two-columns.align-start {
  align-items: start !important;
  gap: 1.5rem !important;
}

.extracted-profile-card {
  padding: 1.5rem !important;
  border: 1px solid rgba(16, 185, 129, 0.15) !important;
  background: #F8FAFC !important;
  border-radius: 12px;
}

.matching-status-card {
  padding: 1.75rem !important;
  text-align: center !important;
  border: 1px solid rgba(16, 185, 129, 0.15) !important;
  background: #ffffff !important;
  min-height: 280px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 1.25rem !important;
  border-radius: 12px;
}

.camera-wrapper {
  position: relative;
  width: min(320px, 100%) !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  margin: 0 auto;
  border-radius: 50%;
  border: 4px solid var(--border);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}

.file-label {
  cursor: pointer;
  transition: all 0.25s ease;
}

.file-label:hover {
  border-color: var(--primary) !important;
  background: rgba(16, 185, 129, 0.04) !important;
}

.summary-list {
  display: grid;
  gap: 0.75rem;
  width: 100%;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-key {
  color: var(--text-soft);
  font-weight: 500;
}

.summary-val {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

/* Email Registration Section */
.email-registration-section {
  padding: 1.25rem 1.5rem;
  border-radius: 14px;
  border: 1.5px solid rgba(16, 185, 129, 0.15);
  background:
    linear-gradient(135deg, rgba(16, 185, 129, 0.04), rgba(4, 120, 87, 0.02)),
    rgba(255, 255, 255, 0.7);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.email-registration-section:focus-within {
  border-color: rgba(4, 120, 87, 0.4);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.08), 0 8px 24px rgba(15, 23, 42, 0.04);
}

.email-section-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.email-section-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

#emailValidation.email-valid {
  color: var(--success);
  font-weight: 600;
}

#emailValidation.email-invalid {
  color: var(--danger);
  font-weight: 600;
}

#emailValidation.email-duplicate {
  color: var(--danger);
  font-weight: 700;
}

/* Credential Success Card (shown after registration) */
.credential-success-card {
  padding: 1.5rem;
  border-radius: 16px;
  border: 1.5px solid rgba(16, 185, 129, 0.2);
  background:
    linear-gradient(145deg, rgba(16, 185, 129, 0.06), rgba(255, 255, 255, 0.9));
  text-align: center;
}

.credential-success-card .success-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  display: block;
}

.credential-success-card h3 {
  color: var(--primary-strong);
  margin-bottom: 0.5rem;
}

.credential-box {
  margin: 1rem auto;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px dashed var(--border);
  text-align: left;
  max-width: 380px;
  font-family: "Plus Jakarta Sans", monospace;
}

.credential-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  font-size: 0.92rem;
}

.credential-row .cred-label {
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.credential-row .cred-value {
  color: var(--text);
  font-weight: 700;
  word-break: break-all;
}

.credential-row .cred-value.password-value {
  color: var(--primary-strong);
  font-family: "Courier New", Courier, monospace;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.credential-warning {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #92400e;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.email-sending-status {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

@keyframes scanRadar {
  0% {
    top: 5%;
  }

  50% {
    top: 90%;
  }

  100% {
    top: 5%;
  }
}

@keyframes spinRadar {
  to {
    transform: rotate(360deg);
  }
}

/* ==============================================
   LOGIN + REGISTRATION - RESPONSIVE MOBILE STYLES
   ============================================== */

/* Tablet */
@media (max-width: 768px) {
  .form-grid.two-columns {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  
  .wizard-container {
    padding: 1.25rem !important;
    margin-top: 0.75rem !important;
  }
  
  .wizard-steps {
    gap: 0.5rem !important;
    margin-bottom: 1.5rem !important;
  }
  
  .wizard-step {
    font-size: 0.78rem !important;
  }

  .camera-wrapper {
    width: min(260px, 75vw) !important;
    height: min(260px, 75vw) !important;
    aspect-ratio: 1 / 1 !important;
  }
  
  #biometricAuthModal .camera-wrapper {
    width: min(240px, 70vw) !important;
    height: min(240px, 70vw) !important;
  }
  
  .modal-card {
    padding: 1rem !important;
  }
}

/* Mobile phones - key spacing fixes */
@media (max-width: 480px) {

  /* --- Login Screen --- */
  .login-view.active-view {
    padding: 0.75rem;
    align-items: flex-start;
    padding-top: clamp(1rem, 6vh, 2.5rem);
  }

  .login-scene {
    width: 100%;
    gap: 0.6rem;
  }

  .login-brand-text p {
    font-size: 1.1rem;
  }

  .portal-card {
    border-radius: 18px;
  }

  .portal-body {
    padding: 0.75rem 0.875rem 0.875rem;
  }

  .portal-heading h2 {
    font-size: 1.25rem;
  }

  /* --- Role Tabs --- */
  .role-tabs {
    gap: 0.2rem !important;
    padding: 0.25rem !important;
    margin: 0.375rem 0.375rem 0 !important;
  }

  .role-tab {
    flex-direction: column !important;
    gap: 0.15rem !important;
    font-size: 0.6rem !important;
    padding: 0.45rem 0.2rem !important;
    min-height: 3.4rem !important;
    border-radius: 10px !important;
  }

  .role-tab .tab-icon {
    width: 1.15rem !important;
    height: 1.15rem !important;
  }

  /* --- Login form fields --- */
  .input-shell input {
    height: 2.9rem;
    font-size: 0.9rem;
  }

  .portal-submit {
    min-height: 2.9rem;
  }

  .login-stats {
    gap: 0.45rem;
  }

  /* --- Registration Wizard --- */
  .wizard-steps {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.3rem !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 1.25rem !important;
  }
  
  .wizard-step {
    padding-bottom: 0.2rem !important;
    border-left: 3px solid var(--border);
    padding-left: 0.75rem;
    width: 100%;
    color: var(--text-faint) !important;
    font-size: 0.8rem !important;
  }
  
  .wizard-step.active::after {
    display: none !important;
  }
  
  .wizard-step.active {
    border-left-color: var(--primary) !important;
    color: var(--primary) !important;
  }

  .wizard-container {
    padding: 1rem !important;
    margin-top: 0.5rem !important;
    border-radius: 16px !important;
  }

  /* --- Registration screen header --- */
  .screen-header {
    padding: 0.875rem 1rem !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }
  
  .header-actions {
    width: 100% !important;
  }
  
  .header-actions button {
    width: 100% !important;
    justify-content: center;
  }

  /* --- Camera Selfie on mobile --- */
  .camera-wrapper {
    width: min(240px, 70vw) !important;
    height: min(240px, 70vw) !important;
    aspect-ratio: 1 / 1 !important;
  }

  /* Make buttons in camera section horizontal and scrollable */
  .form-grid.two-columns > div:first-child > div[style*="display: flex"] {
    flex-wrap: wrap !important;
    justify-content: center !important;
  }

  /* Biometric auth modal camera */
  #biometricAuthModal .camera-wrapper {
    width: min(220px, 65vw) !important;
    height: min(220px, 65vw) !important;
  }

  /* Step wizard next/back button rows */
  div[style*="justify-content: space-between"] {
    gap: 0.75rem;
  }

  .wizard-container {
    padding: 0.875rem !important;
  }
}

/* --- Refined Registration Wizard styling --- */
.screen-header {
  padding: 1.25rem 1.5rem !important;
  border-radius: 16px !important;
  border: 1px solid rgba(16, 185, 129, 0.1) !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03) !important;
  background: #ffffff !important;
  margin-bottom: 1.25rem !important;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 1.5rem;
}

.header-title-area {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.screen-header .eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary) !important;
  margin: 0;
}

.screen-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}

.back-login-btn-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem !important;
  border-radius: 10px !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  min-height: auto !important;
  border: 1.5px solid rgba(148, 163, 184, 0.25) !important;
  background: #ffffff !important;
  color: var(--text-soft) !important;
  transition: all 0.2s ease !important;
  cursor: pointer;
  width: auto !important;
  box-shadow: none !important;
}

.back-login-btn-new:hover {
  background: var(--bg-accent) !important;
  border-color: rgba(148, 163, 184, 0.4) !important;
  color: var(--text) !important;
}

.email-registration-section {
  padding: 1.5rem !important;
  border-radius: 16px !important;
  border: 1.5px solid rgba(16, 185, 129, 0.12) !important;
  background: #ffffff !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.02) !important;
}

.email-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.email-section-icon {
  background: rgba(16, 185, 129, 0.08);
  color: var(--primary);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.email-section-header h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

/* Stepper spacing fixes */
.wizard-steps {
  display: flex !important;
  justify-content: space-between !important;
  margin-bottom: 2rem !important;
  border-bottom: 1px solid var(--border) !important;
  padding-bottom: 0.85rem !important;
  gap: 1.5rem !important;
  width: 100% !important;
}

.wizard-step {
  font-size: 0.92rem !important;
  color: var(--text-faint) !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
  position: relative !important;
  padding-bottom: 0.65rem !important;
  border-left: none !important;
  padding-left: 0 !important;
  flex: 1 !important;
  text-align: center !important;
}

.wizard-step.active {
  color: var(--primary) !important;
  font-weight: 700 !important;
}

.wizard-step.active::after {
  content: "" !important;
  position: absolute !important;
  bottom: -0.95rem !important;
  left: 0 !important;
  right: 0 !important;
  height: 3px !important;
  background: var(--primary) !important;
  border-radius: 99px !important;
}

@media (max-width: 600px) {
  .header-container {
    flex-direction: column-reverse !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .back-login-btn-new {
    width: 100% !important;
    padding: 0.65rem !important;
  }

  .wizard-steps {
    flex-direction: row !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
    border-bottom: 1px solid var(--border) !important;
    padding-bottom: 0.75rem !important;
    margin-bottom: 1.25rem !important;
  }

  .wizard-step {
    font-size: 0.72rem !important;
    padding-bottom: 0.5rem !important;
  }

  .wizard-step.active::after {
    bottom: -0.85rem !important;
  }
}