/* ============================================================
   UFUMBUZI MIS v2 — Premium UI Enhancements
   ============================================================ */

:root {
  --primary-dark: #004d40;
  --gold-bright: #fff176;
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --shadow-glow-gold: 0 0 24px rgba(212, 225, 87, 0.25);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html { font-size: 16px; scroll-behavior: smooth; }
@media (max-width: 380px) { html { font-size: 14px; } }

/* ---- Buttons enhanced ---- */
.btn { border: none; cursor: pointer; font-weight: 500; transition: all var(--transition); }
.btn:active { transform: scale(0.98); }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: 14px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-ghost { background: transparent; color: #9ca3af; padding: 10px 16px; }
.btn-ghost:hover { color: #fff; background: rgba(255,255,255,0.05); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(67,160,71,0.35); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow-gold); }
.badge-gold { background: rgba(212,225,87,0.2); color: var(--gold); }

.input-field { transition: border-color var(--transition), box-shadow var(--transition); }
.input-field:focus { box-shadow: 0 0 0 3px rgba(67,160,71,0.15); }

.link-accent { color: var(--mint); transition: color var(--transition); }
.link-accent:hover { color: var(--lime); text-decoration: underline; }
.link-gold { color: var(--gold); display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.link-gold:hover { color: var(--gold-bright); }

.hide-mobile { display: none; }
@media (min-width: 640px) { .hide-mobile { display: inline-flex; } }

/* ---- Auth pages — viewport fit (no page scroll) ---- */
html:has(.auth-body.auth-fit) {
  height: 100%;
  overflow: hidden;
}
.auth-body.auth-fit {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
.auth-body.auth-fit .auth-page {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: 16px 24px;
  align-items: stretch;
  justify-content: stretch;
}
.auth-body.auth-fit .auth-container {
  height: 100%;
  max-height: 100%;
  max-width: none;
  width: 100%;
  overflow: hidden;
  gap: 0;
  align-items: stretch;
}
@media (min-width: 1024px) {
  .auth-body.auth-fit .auth-container.auth-unified-card {
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0;
    border-radius: 20px;
    border-color: rgba(67,160,71,0.2);
    box-shadow: var(--shadow-lg);
    background: rgba(20,31,24,0.92);
    backdrop-filter: blur(16px);
  }
}
@media (min-width: 1400px) {
  .auth-body.auth-fit .auth-page { padding: 20px 40px; }
}

/* Brand panel — left half of unified card */
@media (min-width: 1024px) {
  .auth-body.auth-fit .auth-brand-panel {
    padding: 24px 28px;
    overflow: hidden;
    align-self: stretch;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, rgba(27,94,32,0.14), rgba(15,22,18,0.35));
    border: none;
    border-radius: 0;
    border-right: 2px dotted rgba(67,160,71,0.45);
    position: relative;
  }
  .auth-body.auth-fit .auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -40%; right: -20%;
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(139,195,74,0.1), transparent 70%);
    pointer-events: none;
  }
}
.auth-body.auth-fit .auth-brand-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  gap: 0;
  position: relative;
  z-index: 1;
}
.auth-body.auth-fit .auth-brand-head { flex-shrink: 0; }
.auth-body.auth-fit .auth-brand-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  min-height: 0;
  padding: 12px 0;
}
.auth-body.auth-fit .auth-brand-foot {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-body.auth-fit .auth-logo-link { margin-bottom: 14px; gap: 12px; }
.auth-body.auth-fit .auth-logo { width: 44px; height: 44px; }
.auth-body.auth-fit .auth-logo-title { font-size: 19px; }
.auth-body.auth-fit .auth-brand-heading { font-size: clamp(1.2rem, 1.8vw, 1.5rem); margin-bottom: 8px; line-height: 1.25; }
.auth-body.auth-fit .auth-brand-text { font-size: 12px; line-height: 1.45; margin: 0; }
.auth-body.auth-fit .auth-feature-list {
  margin: 0; gap: 8px;
  display: flex; flex-direction: column;
}
.auth-body.auth-fit .auth-feature-list li { font-size: 12px; gap: 8px; line-height: 1.4; }
.auth-body.auth-fit .auth-feature-list svg { width: 14px; height: 14px; margin-top: 2px; }
.auth-body.auth-fit .auth-role-pills { margin: 0; gap: 6px; }
.auth-body.auth-fit .auth-role-pill { padding: 4px 10px; font-size: 10px; }
.auth-body.auth-fit .auth-brand-stats { margin: 0; gap: 10px; }
.auth-body.auth-fit .auth-brand-modules { margin: 0; gap: 8px; }
.auth-body.auth-fit .auth-stat { padding: 12px 10px; }
.auth-body.auth-fit .auth-stat-value { font-size: 1.15rem; }
.auth-body.auth-fit .auth-brand-modules span { padding: 10px 6px; font-size: 10px; gap: 5px; }
.auth-body.auth-fit .auth-brand-modules svg { width: 17px; height: 17px; }

.auth-brand-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.auth-stat {
  padding: 14px 12px; border-radius: 12px; text-align: center;
  background: rgba(67,160,71,0.08); border: 1px solid rgba(67,160,71,0.18);
}
.auth-stat-value {
  display: block; font-family: var(--font-display); font-size: 1.25rem;
  font-weight: 700; color: var(--mint); line-height: 1.2;
}
.auth-stat-label { display: block; font-size: 10px; color: #9ca3af; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.06em; }
.auth-brand-modules {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.auth-brand-modules span {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px; border-radius: 10px; font-size: 10px; font-weight: 500;
  color: #9ca3af; background: rgba(15,22,18,0.6); border: 1px solid rgba(67,160,71,0.12);
}
.auth-brand-modules svg { width: 18px; height: 18px; color: var(--mint); }

/* Form panel — right half of unified card */
.auth-body.auth-fit .auth-form-panel {
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  align-self: stretch;
  height: 100%;
}
@media (min-width: 1024px) {
  .auth-body.auth-fit .auth-form-panel {
    display: flex;
    flex-direction: column;
  }
}
.auth-body.auth-fit .auth-form-card {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 24px 28px;
  justify-content: flex-start;
}
@media (min-width: 1024px) {
  .auth-body.auth-fit .auth-unified-card .auth-form-card {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    backdrop-filter: none;
  }
}
.auth-body.auth-fit .auth-tabs { margin-bottom: 16px; flex-shrink: 0; }
.auth-body.auth-fit .auth-tab { padding: 9px 14px; font-size: 13px; }
.auth-body.auth-fit .auth-form-header { margin-bottom: 14px; flex-shrink: 0; }
.auth-body.auth-fit .auth-form-header h2 { font-size: 1.35rem; }
.auth-body.auth-fit .auth-form-header p { font-size: 13px; margin-top: 4px; }
.auth-body.auth-fit .auth-form {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.auth-body.auth-fit .auth-form.auth-form-spread { justify-content: center; gap: 4px; }
.auth-body.auth-fit .auth-form.auth-form-spread .form-group:last-of-type { margin-bottom: 0; }
.auth-body.auth-fit .auth-form.auth-form-spread > .btn { margin-top: 8px; flex-shrink: 0; }
.auth-body.auth-fit .auth-form .form-group { margin-bottom: 12px; }
.auth-body.auth-fit .auth-form label { font-size: 12px; margin-bottom: 4px; }
.auth-body.auth-fit .input-compact,
.auth-body.auth-fit .input-field { padding: 10px 14px; font-size: 14px; }
.auth-body.auth-fit .input-icon-wrap .input-field { padding-left: 40px; padding-right: 40px; }
.auth-body.auth-fit .form-row { margin-bottom: 14px; font-size: 13px; }
.auth-body.auth-fit .auth-form-footer-compact {
  margin-top: auto; padding-top: 14px; flex-shrink: 0;
  border-top: 1px solid var(--border);
}
.auth-body.auth-fit .auth-form-footer-compact p { font-size: 13px; margin-top: 6px; }
.auth-body.auth-fit .auth-admin-link { margin-top: 6px !important; }

/* Registration */
.auth-body.auth-fit .reg-steps-compact { margin-bottom: 16px; flex-shrink: 0; }
.auth-body.auth-fit .reg-step span { width: 30px; height: 30px; font-size: 12px; }
.auth-body.auth-fit .reg-step small { font-size: 10px; }
.auth-body.auth-fit .reg-step-line { margin-bottom: 14px; max-width: 40px; }
.auth-body.auth-fit .reg-panel.active {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.auth-body.auth-fit .reg-compact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  flex: 1;
  min-height: 0;
  align-content: space-evenly;
}
.auth-body.auth-fit .col-full { grid-column: 1 / -1; }
.auth-body.auth-fit .form-section-label {
  font-size: 11px; margin-bottom: 2px; margin-top: 4px;
  display: flex !important;
}
.auth-body.auth-fit .field-hint { display: none; }
.auth-body.auth-fit .country-institution-display {
  padding: 0; margin-top: 4px; font-size: 11px;
  display: flex !important;
  background: none; border: none;
  color: #6b7280;
}
.auth-body.auth-fit .country-institution-display strong { color: var(--mint); font-weight: 500; }
.auth-body.auth-fit .country-institution-display svg { width: 12px; height: 12px; }
.auth-body.auth-fit .role-option-compact { padding: 10px 6px; font-size: 11px; gap: 5px; }
.auth-body.auth-fit .role-option-compact svg { width: 18px; height: 18px; }
.auth-body.auth-fit .institution-types-compact { gap: 8px; grid-template-columns: repeat(4, 1fr); }
.auth-body.auth-fit .phone-field label { font-size: 12px; margin-bottom: 4px; }
.auth-body.auth-fit .country-picker-btn { min-width: 100px; padding: 0 10px; }
.auth-body.auth-fit .phone-number-input { padding: 10px 14px; font-size: 14px; }
.auth-body.auth-fit .reg-submit-btn,
.auth-body.auth-fit .reg-submit-row { margin-top: auto; flex-shrink: 0; padding-top: 12px; }
.auth-body.auth-fit .password-strength { margin-bottom: 8px; height: 4px; }
.auth-body.auth-fit .plan-selector-compact { gap: 8px; margin-bottom: 12px; flex: 1; align-content: start; }
.auth-body.auth-fit .plan-option-compact { padding: 14px 10px; }
.auth-body.auth-fit .plan-option-compact .plan-name { font-size: 13px; }
.auth-body.auth-fit .plan-option-compact .plan-desc { font-size: 11px; }
.auth-body.auth-fit .otp-compact .otp-input { width: 40px; height: 44px; font-size: 18px; }
.auth-body.auth-fit .otp-compact { gap: 6px; }
.auth-body.auth-fit .terms-compact { font-size: 12px; margin: 8px 0; }
.auth-body.auth-fit .text-center-label { display: block; text-align: center; font-size: 12px; margin-bottom: 8px; color: #9ca3af; }
.auth-body.auth-fit .back-link-compact { margin-bottom: 12px; font-size: 13px; }
.auth-body.auth-fit .forgot-icon-wrap { display: none; }
.auth-body.auth-fit .auth-form-header-compact { margin-bottom: 12px; }
.auth-body.auth-fit .auth-form-header-compact h2 { font-size: 1.25rem; }
.auth-body.auth-fit .auth-form-header-compact p { font-size: 12px; }

@media (max-width: 1023px) {
  .auth-body.auth-fit { height: auto; max-height: none; overflow-y: auto; }
  .auth-body.auth-fit .auth-page { height: auto; max-height: none; min-height: 100dvh; overflow-y: auto; padding: 12px; }
  .auth-body.auth-fit .auth-container.auth-unified-card {
    border-radius: 16px;
    height: auto;
    max-height: none;
  }
  .auth-body.auth-fit .auth-form-card { height: auto; max-height: none; }
  .auth-body.auth-fit .auth-brand-panel { height: auto; border-right: none; }
}

@media (max-height: 760px) {
  .auth-body.auth-fit .auth-page { padding: 10px 16px; }
  @media (min-width: 1024px) {
    .auth-body.auth-fit .auth-brand-panel { padding: 16px 20px; }
  }
  .auth-body.auth-fit .auth-form-card { padding: 16px 20px; }
  .auth-body.auth-fit .auth-logo { width: 44px; height: 44px; }
  .auth-body.auth-fit .auth-brand-heading { font-size: 1.2rem; }
  .auth-body.auth-fit .auth-brand-text { font-size: 12px; }
  .auth-body.auth-fit .auth-feature-list { gap: 6px; margin-top: 10px; }
  .auth-body.auth-fit .auth-feature-list li { font-size: 12px; }
  .auth-body.auth-fit .auth-brand-modules { display: none; }
  .auth-body.auth-fit .auth-stat { padding: 10px 8px; }
  .auth-body.auth-fit .auth-stat-value { font-size: 1.1rem; }
  .auth-body.auth-fit .auth-form .form-group { margin-bottom: 8px; }
  .auth-body.auth-fit .input-compact,
  .auth-body.auth-fit .input-field { padding: 8px 12px; font-size: 13px; }
  .auth-body.auth-fit .role-option-compact { padding: 7px 4px; font-size: 10px; }
  .auth-body.auth-fit .country-institution-display { display: none !important; }
}

@media (max-height: 680px) {
  .auth-body.auth-fit .auth-brand-text { display: none; }
  .auth-body.auth-fit .auth-role-pills { display: none; }
  .auth-body.auth-fit .auth-brand-stats { gap: 8px; }
}

/* ---- Auth form-only layout (login / register) ---- */
.auth-body.auth-form-only {
  min-height: 100dvh;
  overflow-y: auto;
}
.auth-body.auth-form-only .auth-page {
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.auth-body.auth-form-only .auth-container.auth-form-only-wrap {
  width: 100%;
  max-width: 500px;
  display: block;
  animation: fadeUp 0.5s ease-out;
}
.auth-body.auth-form-only .auth-form-panel {
  width: 100%;
  height: auto;
  max-height: none;
  overflow: visible;
}
.auth-body.auth-form-only .auth-form-card {
  padding: clamp(28px, 5vw, 36px);
  border-radius: 20px;
  border-color: rgba(67,160,71,0.18);
  box-shadow: var(--shadow-lg);
  height: auto;
  max-height: none;
  overflow: visible;
  display: block;
}
.auth-body.auth-form-only .auth-form-logo {
  text-align: center;
  margin-bottom: 20px;
}
.auth-body.auth-form-only .auth-logo-link-centered {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 12px;
  background: #f4f7f5;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(67,160,71,0.12);
}
.auth-body.auth-form-only .auth-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: none;
}
.auth-body.auth-form-only .auth-tabs {
  margin-bottom: 20px;
}
.auth-body.auth-form-only .auth-form-header {
  margin-bottom: 20px;
  text-align: center;
}
.auth-body.auth-form-only .auth-form-header h2 {
  font-size: 1.4rem;
}
.auth-body.auth-form-only .auth-form {
  display: block;
  overflow: visible;
}
.auth-body.auth-form-only .auth-form-footer-compact {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.auth-body.auth-form-only .reg-steps-compact {
  margin-bottom: 20px;
}
.auth-body.auth-form-only .reg-compact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
.auth-body.auth-form-only .reg-panel.active {
  display: flex;
  flex-direction: column;
  gap: 0;
}
@media (max-width: 480px) {
  .auth-body.auth-form-only .reg-compact-grid {
    grid-template-columns: 1fr;
  }
  .auth-body.auth-form-only .auth-container.auth-form-only-wrap {
    max-width: 100%;
  }
}

/* Register — wide form card (60% page width) */
.auth-body.auth-form-wide .auth-container.auth-form-wide-wrap {
  width: 60%;
  max-width: 60%;
}
.auth-body.auth-form-wide .auth-form-card-register {
  padding: clamp(32px, 4vw, 44px) clamp(36px, 5vw, 56px);
}
.auth-body.auth-form-wide .auth-form-header {
  text-align: center;
  margin-bottom: 24px;
}
.auth-body.auth-form-wide .auth-form-header h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  margin-bottom: 8px;
}
.auth-body.auth-form-wide .auth-form-header p {
  font-size: 14px;
  color: #9ca3af;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.5;
}
.auth-body.auth-form-wide .reg-steps-compact {
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 28px;
}
.auth-body.auth-form-wide .reg-compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}
.auth-body.auth-form-wide .col-full {
  grid-column: 1 / -1;
}
.auth-body.auth-form-wide .auth-form .form-group {
  margin-bottom: 0;
}
.auth-body.auth-form-wide .form-section-label {
  margin-top: 4px;
  margin-bottom: 2px;
}
.auth-body.auth-form-wide .form-section-label:first-child {
  margin-top: 0;
}
.auth-body.auth-form-wide .institution-types,
.auth-body.auth-form-wide .institution-types-compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.auth-body.auth-form-wide .role-option-compact {
  padding: 14px 10px;
  font-size: 12px;
}
.auth-body.auth-form-wide .reg-submit-btn {
  margin-top: 24px;
}
.auth-body.auth-form-wide .reg-panel-step-two.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.auth-body.auth-form-wide .reg-inline-label {
  margin-bottom: 10px;
}
.auth-body.auth-form-wide .plan-selector-compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 0;
}
.auth-body.auth-form-wide .plan-option-compact {
  padding: 18px 14px;
  height: 100%;
}
.auth-body.auth-form-wide .reg-otp-group {
  text-align: center;
}
.otp-help {
  font-size: 13px;
  color: #9ca3af;
  margin: 0 0 12px;
  line-height: 1.5;
}
.otp-resend {
  margin: 12px auto 0;
  display: inline-flex;
  min-width: 148px;
  justify-content: center;
  transition: opacity var(--transition), color var(--transition);
}
.otp-resend.hidden {
  display: none;
}
.otp-resend:disabled,
.otp-resend.otp-resend-waiting {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.reg-success {
  text-align: center;
  padding: 8px 4px 4px;
  animation: fadeUp 0.5s ease-out;
}
.reg-success-icon {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
}
.reg-success-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(67, 160, 71, 0.25);
  animation: regSuccessRing 0.8s ease-out forwards;
}
.reg-success-check {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(27, 94, 32, 0.45), rgba(67, 160, 71, 0.35));
  box-shadow: 0 8px 32px rgba(67, 160, 71, 0.25);
  animation: regSuccessPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}
.reg-success-check svg {
  width: 36px;
  height: 36px;
  color: var(--gold);
}
.reg-success-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 8px;
  background: linear-gradient(to right, #e5e7eb, var(--mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.reg-success-lead {
  font-size: 14px;
  color: #9ca3af;
  line-height: 1.6;
  margin: 0 0 20px;
}
.reg-success-lead strong {
  color: #e5e7eb;
}
.reg-success-card {
  text-align: left;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(67, 160, 71, 0.08);
  border: 1px solid rgba(67, 160, 71, 0.22);
  margin-bottom: 24px;
}
.reg-success-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  color: #9ca3af;
  line-height: 1.55;
}
.reg-success-row + .reg-success-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.reg-success-row svg {
  width: 18px;
  height: 18px;
  color: var(--mint);
  flex-shrink: 0;
  margin-top: 1px;
}
.reg-success-row strong {
  color: #d1d5db;
  font-weight: 600;
}
.reg-success-redirect {
  max-width: 280px;
  margin: 0 auto;
}
.reg-success-progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 10px;
}
.reg-success-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(to right, var(--secondary), var(--mint));
  transition: width 1s linear;
}
.reg-success-countdown {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}
.reg-success-countdown span {
  color: var(--mint);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.reg-success.reg-success-email-pending .reg-success-check {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.35), rgba(245, 158, 11, 0.25));
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.18);
}
.reg-success.reg-success-email-pending .reg-success-check svg {
  color: #fbbf24;
}
.reg-success.reg-success-email-pending .reg-success-ring {
  border-color: rgba(245, 158, 11, 0.35);
}
.reg-success.reg-success-email-pending .reg-success-card {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.22);
}
@keyframes regSuccessRing {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes regSuccessPop {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.auth-body.auth-form-wide .terms-compact {
  margin: 0;
}
.auth-body.auth-form-wide .reg-submit-row {
  margin-top: 4px;
}
.auth-body.auth-form-wide .phone-input-group {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.auth-body.auth-form-wide .phone-number-input {
  flex: 1;
  min-width: 0;
}
@media (max-width: 900px) {
  .auth-body.auth-form-wide .auth-container.auth-form-wide-wrap {
    width: 90%;
    max-width: 90%;
  }
}
@media (max-width: 640px) {
  .auth-body.auth-form-wide .auth-container.auth-form-wide-wrap {
    width: 100%;
    max-width: 100%;
  }
  .auth-body.auth-form-wide .reg-compact-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .auth-body.auth-form-wide .institution-types,
  .auth-body.auth-form-wide .institution-types-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .auth-body.auth-form-wide .plan-selector-compact {
    grid-template-columns: 1fr;
  }
  .auth-body.auth-form-wide .auth-form-card-register {
    padding: 24px 20px;
  }
}

@media (min-width: 1024px) {
  .auth-unified-card > .auth-brand-panel {
    border-radius: 0;
    border: none;
    border-right: 2px dotted rgba(67,160,71,0.45);
    align-self: stretch;
    height: 100%;
  }
  .auth-unified-card > .auth-form-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .auth-unified-card > .auth-form-panel > .auth-form-card {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    backdrop-filter: none;
    flex: 1;
  }
}

.auth-body { overflow-x: hidden; }
.auth-page { min-height: 100vh; min-height: 100dvh; position: relative; display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth-bg-glow {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 20% 30%, rgba(27,94,32,0.15), transparent),
              radial-gradient(ellipse 60% 50% at 80% 70%, rgba(212,225,87,0.06), transparent);
}
.auth-container {
  position: relative; z-index: 1; width: 100%; max-width: 1100px;
  display: grid; gap: 24px; align-items: start;
  animation: fadeUp 0.6s ease-out;
}
@media (min-width: 1024px) {
  .auth-container { grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
}

.auth-brand-panel {
  display: none; border-radius: 20px; padding: 28px 28px 24px;
  background: linear-gradient(145deg, rgba(27,94,32,0.25), rgba(15,22,18,0.9));
  border: 1px solid rgba(67,160,71,0.2); position: relative; overflow: hidden;
  align-self: start; height: auto;
}
@media (min-width: 1024px) {
  .auth-brand-panel { display: flex; align-items: flex-start; }
}
.auth-brand-panel::before {
  content: ''; position: absolute; top: -50%; right: -30%; width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(139,195,74,0.12), transparent 70%); pointer-events: none;
}
.auth-brand-inner { position: relative; width: 100%; }
.auth-logo-link { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.auth-logo { width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(0,0,0,0.4)); }
.auth-logo-title { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 800; color: #fff; letter-spacing: 0.02em; }
.auth-logo-tag { display: block; font-size: 10px; color: rgba(139,195,74,0.8); text-transform: uppercase; letter-spacing: 0.12em; margin-top: 2px; }
.auth-brand-heading { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; line-height: 1.2; margin-bottom: 12px; }
.auth-brand-text { color: #9ca3af; line-height: 1.6; font-size: 14px; }
.auth-feature-list { list-style: none; margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.auth-feature-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: #d1d5db; }
.auth-feature-list svg { width: 18px; height: 18px; color: var(--mint); flex-shrink: 0; margin-top: 1px; }
.auth-role-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; margin-bottom: 0; }
.auth-role-pill {
  padding: 6px 14px; border-radius: 99px; font-size: 11px; font-weight: 600;
  background: rgba(67,160,71,0.12); border: 1px solid rgba(67,160,71,0.25); color: var(--mint);
}

.auth-form-panel { display: flex; flex-direction: column; justify-content: flex-start; width: 100%; align-self: start; }
.auth-form-card { padding: clamp(24px, 4vw, 36px); border-radius: 20px; border-color: rgba(67,160,71,0.15); box-shadow: var(--shadow-lg); }
.auth-tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-surface); border-radius: 12px; margin-bottom: 28px; }
.auth-tab {
  flex: 1; text-align: center; padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 500;
  color: #9ca3af; transition: all var(--transition);
}
.auth-tab:hover { color: #fff; }
.auth-tab.active { background: linear-gradient(to right, var(--secondary), var(--accent)); color: #fff; box-shadow: var(--shadow-glow); }
.auth-form-header { margin-bottom: 24px; }
.auth-form-header h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.auth-form-header p { color: #9ca3af; font-size: 14px; margin-top: 4px; }
.auth-form .form-group { margin-bottom: 18px; }
.auth-form label { display: block; font-size: 13px; font-weight: 500; color: #d1d5db; margin-bottom: 6px; }
.label-optional { color: #6b7280; font-weight: 400; }
.form-row-2 { display: grid; gap: 16px; }
@media (min-width: 480px) { .form-row-2 { grid-template-columns: 1fr 1fr; } }
.form-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; font-size: 13px; }
.checkbox-label { display: flex; align-items: flex-start; gap: 8px; color: #9ca3af; cursor: pointer; font-size: 13px; line-height: 1.4; }
.checkbox-label input { margin-top: 3px; accent-color: var(--accent); }
.form-actions-row { display: flex; gap: 12px; margin-top: 8px; }
.form-actions-row .btn { flex: 1; }

.input-icon-wrap { position: relative; }
.input-icon-wrap > svg, .input-icon-wrap > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #6b7280; pointer-events: none; z-index: 1; }
.input-icon-wrap .input-field { padding-left: 44px; }
.input-icon-wrap:has(.password-toggle) .input-field { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  padding: 0; color: #6b7280; background: none; border: none; cursor: pointer;
}
.password-toggle svg,
.password-toggle i {
  position: static !important;
  transform: none !important;
  width: 18px; height: 18px; pointer-events: none;
}
.password-toggle:hover { color: var(--mint); }

.auth-form-footer { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); text-align: center; }
.auth-form-footer p { font-size: 14px; color: #6b7280; margin-top: 8px; }
.auth-form-footer p:first-child { margin-top: 0; }
.auth-admin-link { margin-top: 12px !important; }
.auth-security-note {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 20px; font-size: 12px; color: #4b5563; text-align: center;
}
.auth-security-note svg { width: 14px; height: 14px; color: var(--mint); }

.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #9ca3af; margin-bottom: 20px; transition: color var(--transition); }
.back-link:hover { color: var(--mint); }
.forgot-icon-wrap, .verify-icon {
  width: 64px; height: 64px; border-radius: 16px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(27,94,32,0.3), rgba(67,160,71,0.2));
  display: flex; align-items: center; justify-content: center;
}
.forgot-icon-wrap svg, .verify-icon svg { width: 28px; height: 28px; color: var(--mint); }
.verify-icon.success svg { color: var(--gold); }
.verify-box { text-align: center; padding: 16px 0 24px; }
.verify-box h3 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 8px; }
.verify-box p { font-size: 13px; color: #9ca3af; line-height: 1.6; }
.reset-success { text-align: center; padding: 16px 0; }
.reset-success h3 { font-family: var(--font-display); font-size: 1.25rem; margin: 16px 0 8px; }
.reset-success p { font-size: 14px; color: #9ca3af; line-height: 1.6; }
.reset-tips { padding: 20px; margin-top: 24px; text-align: left; }
.reset-tips ul { list-style: disc; padding-left: 20px; margin: 12px 0 16px; }
.reset-tips li { font-size: 13px; color: #9ca3af; margin-bottom: 4px; }

/* Registration */
.reg-steps { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 28px; }
.reg-step { display: flex; flex-direction: column; align-items: center; gap: 4px; opacity: 0.4; transition: opacity var(--transition); }
.reg-step.active, .reg-step.done { opacity: 1; }
.reg-step span {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; background: var(--bg-surface); border: 2px solid var(--border);
}
.reg-step.active span { background: linear-gradient(to right, var(--secondary), var(--accent)); border-color: transparent; color: #fff; }
.reg-step.done span { background: var(--mint); border-color: transparent; color: var(--bg-dark); }
.reg-step small { font-size: 10px; color: #9ca3af; }
.reg-step-line { flex: 1; max-width: 48px; height: 2px; background: var(--border); margin-bottom: 16px; }
.reg-panel { display: none; animation: fadeUp 0.4s ease-out; }
.reg-panel.active { display: block; }

.role-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.role-option input { position: absolute; opacity: 0; pointer-events: none; }
.role-option-box {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--bg-surface);
  font-size: 12px; font-weight: 500; color: #9ca3af; cursor: pointer; transition: all var(--transition); text-align: center;
}
.role-option-box svg { width: 20px; height: 20px; }
.role-option input:checked + .role-option-box {
  border-color: var(--accent); background: rgba(67,160,71,0.1); color: var(--mint);
  box-shadow: 0 0 0 1px rgba(67,160,71,0.3);
}

.password-strength { height: 4px; background: var(--bg-surface); border-radius: 99px; margin-bottom: 16px; overflow: hidden; }
.password-strength-bar { height: 100%; width: 0; border-radius: 99px; transition: width 0.3s, background 0.3s; background: var(--accent); }

.otp-inputs { display: flex; gap: 8px; justify-content: center; }
.otp-input {
  width: 44px; height: 52px; text-align: center; font-size: 20px; font-weight: 700;
  border-radius: 12px; background: var(--bg-surface); border: 1px solid var(--border); color: #fff;
}
.otp-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(67,160,71,0.15); }
@media (max-width: 380px) { .otp-input { width: 38px; height: 46px; font-size: 18px; } }
.terms-check { margin: 16px 0; }

/* ---- Admin portal ---- */
.admin-body { --admin-accent: var(--gold); }
.admin-layout .sidebar-admin { border-right-color: rgba(212,225,87,0.15); }
.admin-badge {
  display: inline-block; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 4px;
  background: linear-gradient(to right, rgba(212,225,87,0.3), rgba(255,241,118,0.2));
  color: var(--gold); vertical-align: middle; margin-left: 4px; letter-spacing: 0.05em;
}
.sidebar-admin .nav-item-active {
  background: linear-gradient(to right, rgba(212,225,87,0.15), rgba(67,160,71,0.15)) !important;
  border-color: rgba(212,225,87,0.3) !important;
}
.admin-quick-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-stat-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px;
  font-size: 12px; font-weight: 500; background: rgba(67,160,71,0.12); border: 1px solid rgba(67,160,71,0.25); color: var(--mint);
}
.admin-stat-pill svg { width: 14px; height: 14px; }
.admin-stat-pill.gold { background: rgba(212,225,87,0.1); border-color: rgba(212,225,87,0.25); color: var(--gold); }

.health-row { display: flex; align-items: center; gap: 12px; }
.health-info { flex: 0 0 140px; min-width: 0; }
.health-bar-wrap { flex: 1; min-width: 60px; }

.filters-bar { border-radius: 16px; }
.filters-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.filters-search { flex: 1; min-width: 200px; display: block !important; max-width: none; }
.filter-select { width: auto; min-width: 140px; flex: 0 1 auto; }

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell-avatar {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(to bottom right, var(--secondary), var(--accent));
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.table-actions { display: flex; gap: 4px; }
.icon-btn-sm { padding: 6px; border-radius: 8px; color: #9ca3af; transition: all var(--transition); }
.icon-btn-sm:hover { background: var(--bg-surface); color: var(--mint); }
.icon-btn-sm svg { width: 16px; height: 16px; }

.role-card { transition: border-color var(--transition), transform var(--transition); }
.role-card:hover { border-color: rgba(67,160,71,0.4); transform: translateY(-2px); }
.role-card-header { display: flex; align-items: center; gap: 12px; }
.role-icon-wrap {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--role-color) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--role-color) 30%, transparent);
}
.role-icon-wrap svg { width: 20px; height: 20px; color: var(--role-color); }
.permission-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.perm-tag { padding: 3px 10px; border-radius: 6px; font-size: 11px; font-family: monospace; background: var(--bg-surface); color: #9ca3af; border: 1px solid var(--border); }
.role-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.institution-card { transition: all var(--transition); }
.institution-card:hover { border-color: rgba(67,160,71,0.4); transform: translateY(-3px); }
.institution-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.institution-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(27,94,32,0.3), rgba(67,160,71,0.2));
  display: flex; align-items: center; justify-content: center;
}
.institution-icon svg { width: 24px; height: 24px; color: var(--mint); }
.institution-stats { display: flex; gap: 24px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.inst-stat-val { display: block; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: #fff; }
.inst-stat-lbl { font-size: 11px; color: #6b7280; }
.institution-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 220px; border-style: dashed; cursor: pointer; color: #9ca3af;
}
.institution-add svg { width: 40px; height: 40px; color: var(--mint); margin-bottom: 12px; }
.institution-add:hover { border-color: var(--accent); color: var(--mint); }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(30,51,40,0.4); }
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; border-radius: 99px; background: var(--bg-surface); border: 1px solid var(--border); cursor: pointer; transition: var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px;
  border-radius: 50%; background: #6b7280; transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); background: #fff; }
.branding-preview { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--bg-surface); border-radius: 12px; }
.branding-preview img { width: 64px; height: 64px; object-fit: contain; }
.color-input { height: 44px; padding: 4px; cursor: pointer; }
.danger-outline { border-color: rgba(239,68,68,0.3) !important; color: #f87171 !important; }
.danger-outline:hover { background: rgba(239,68,68,0.1) !important; }

/* ---- Responsive tables ---- */
@media (max-width: 767px) {
  .responsive-table thead { display: none; }
  .responsive-table tbody tr {
    display: block; padding: 16px; margin-bottom: 12px;
    background: rgba(15,22,18,0.5); border-radius: 12px; border: 1px solid var(--border);
  }
  .responsive-table tbody tr:hover { background: rgba(15,22,18,0.8); }
  .responsive-table td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid rgba(30,51,40,0.3); text-align: right;
  }
  .responsive-table td:last-child { border-bottom: none; }
  .responsive-table td::before {
    content: attr(data-label); font-weight: 600; font-size: 11px; color: #9ca3af;
    text-transform: uppercase; text-align: left; margin-right: 12px;
  }
  .responsive-table td[data-label=""]::before { display: none; }
}

/* ---- Layout responsive improvements ---- */
@media (max-width: 767px) {
  .page-title { font-size: 1.5rem; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; justify-content: center; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-value { font-size: 1.75rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .tabs { -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .landing-nav { flex-wrap: wrap; gap: 12px; }
  .landing-nav-actions { width: 100%; justify-content: flex-end; }
  .landing-nav-actions .btn { padding: 8px 14px; font-size: 13px; }
  .hero { padding: 32px 16px 60px; }
  .hero h2 { font-size: 2rem; }
  .hero-desc { font-size: 16px; }
  .modules-section, .features-section { padding: 48px 16px; }
  .cta-box { padding: 32px 20px; }
  .cta-box h3 { font-size: 1.35rem; }
  .filters-row { flex-direction: column; }
  .filter-select { width: 100%; }
  .form-actions-row { flex-direction: column; }
  .role-selector { grid-template-columns: 1fr; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .modules-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Touch-friendly targets */
@media (hover: none) and (pointer: coarse) {
  .nav-item { padding: 12px 14px; min-height: 44px; }
  .btn { min-height: 44px; }
  .tab-btn { min-height: 40px; padding: 10px 16px; }
}

/* Safe areas for notched phones */
@supports (padding: max(0px)) {
  .auth-page { padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .topbar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .page-content { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Glass card hover globally */
.glass-card { transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.module-card:hover, .stat-card:hover { transform: translateY(-2px); }

/* Improved scrollbar for sidebar */
.sidebar-nav { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* Topbar mobile search toggle area */
@media (max-width: 639px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .user-info { display: none !important; }
}

.justify-start { justify-content: flex-start !important; }

.topbar-admin-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  background: rgba(212,225,87,0.12); border: 1px solid rgba(212,225,87,0.25); color: var(--gold);
  flex-shrink: 0;
}
.topbar-admin-badge svg { width: 14px; height: 14px; }
@media (max-width: 480px) { .topbar-admin-badge .topbar-admin-text { display: none; } }

/* Institution registration (multi-tenant) */
.field-hint { display: block; font-size: 11px; color: #6b7280; margin-top: 4px; }
.subdomain-wrap { display: flex; align-items: stretch; gap: 0; }
.subdomain-wrap .input-field { border-radius: var(--radius) 0 0 var(--radius); border-right: none; flex: 1; }
.subdomain-suffix {
  display: flex; align-items: center; padding: 0 14px; font-size: 13px; color: #9ca3af;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) 0;
  white-space: nowrap;
}
@media (max-width: 480px) { .subdomain-suffix { font-size: 11px; padding: 0 10px; } }

.institution-types { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 480px) { .institution-types { grid-template-columns: repeat(4, 1fr); } }

.tenant-info-banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 20px;
  background: rgba(67,160,71,0.08); border-color: rgba(67,160,71,0.2); border-radius: 12px;
}
.tenant-info-banner svg { width: 18px; height: 18px; color: var(--mint); flex-shrink: 0; margin-top: 2px; }
.tenant-info-banner p { font-size: 13px; color: #9ca3af; line-height: 1.5; }

.plan-selector { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 640px) { .plan-selector { flex-direction: row; } }
.plan-option { flex: 1; }
.plan-option input { position: absolute; opacity: 0; pointer-events: none; }
.plan-option-box {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg-surface); cursor: pointer; transition: all var(--transition); height: 100%;
}
.plan-option input:checked + .plan-option-box {
  border-color: var(--gold); background: rgba(212,225,87,0.06);
  box-shadow: 0 0 0 1px rgba(212,225,87,0.3);
}
.plan-name { font-weight: 600; color: #fff; font-size: 14px; }
.plan-desc { font-size: 12px; color: #9ca3af; }
.plan-badge { font-size: 10px; font-weight: 600; color: var(--gold); margin-top: 4px; }

.mt-2 { margin-top: 8px; }

/* Form section labels & required */
.form-section-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--mint); margin-bottom: 16px; margin-top: 4px;
}
.form-section-label svg { width: 16px; height: 16px; }
.mt-section { margin-top: 24px !important; }
.req { color: var(--gold); font-weight: 600; }

/* Phone + country code picker */
.phone-field label { display: block; font-size: 13px; font-weight: 500; color: #d1d5db; margin-bottom: 6px; }
.phone-input-group {
  display: flex; align-items: stretch; gap: 0; position: relative;
}
.country-picker { position: relative; flex-shrink: 0; }
.country-picker-btn {
  display: flex; align-items: center; gap: 6px; height: 100%;
  padding: 0 12px; min-width: 110px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius); border-right: none;
  color: #f3f4f6; font-size: 14px; cursor: pointer; transition: border-color var(--transition);
}
.country-picker-btn:hover, .country-picker-btn[aria-expanded="true"] {
  border-color: var(--accent); background: rgba(67,160,71,0.06);
}
.country-flag { font-size: 20px; line-height: 1; }
.country-dial { font-family: ui-monospace, monospace; font-size: 13px; color: var(--mint); font-weight: 600; }
.country-chevron { width: 14px; height: 14px; color: #6b7280; margin-left: auto; transition: transform var(--transition); }
.country-picker-btn[aria-expanded="true"] .country-chevron { transform: rotate(180deg); }

.phone-number-input {
  border-radius: 0 var(--radius) var(--radius) 0 !important;
  flex: 1; min-width: 0;
}

.institution-country-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.country-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 100;
  width: min(320px, calc(100vw - 48px)); max-height: 280px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden;
  display: flex; flex-direction: column;
}
.country-dropdown.hidden { display: none; }
.country-search-wrap {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.country-search-wrap svg { width: 16px; height: 16px; color: #6b7280; flex-shrink: 0; }
.country-search {
  flex: 1; background: transparent; border: none; color: #f3f4f6;
  font-size: 14px; outline: none;
}
.country-search::placeholder { color: #6b7280; }
.country-list {
  list-style: none; overflow-y: auto; flex: 1;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.country-option {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  cursor: pointer; transition: background var(--transition); font-size: 14px;
}
.country-option:hover, .country-option.selected { background: rgba(67,160,71,0.1); }
.country-option-flag { font-size: 22px; line-height: 1; flex-shrink: 0; }
.country-option-name { flex: 1; color: #e5e7eb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.country-option-dial { font-family: ui-monospace, monospace; font-size: 13px; color: var(--mint); flex-shrink: 0; }
.country-option.hidden { display: none; }

.country-institution-display {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(67,160,71,0.08); border: 1px solid rgba(67,160,71,0.2);
  font-size: 13px; color: #9ca3af;
}
.country-institution-display svg { width: 16px; height: 16px; color: var(--mint); flex-shrink: 0; }
.country-institution-display strong { color: var(--mint); font-weight: 600; }

@media (max-width: 480px) {
  .country-picker-btn { min-width: 96px; padding: 0 8px; }
  .country-dial { font-size: 12px; }
}

.auth-alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.auth-alert-error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.auth-alert-success {
  background: rgba(67, 160, 71, 0.12);
  border-color: rgba(67, 160, 71, 0.35);
  color: #86efac;
}
.form-hint {
  font-size: 12px;
  color: #f87171;
  margin-top: 6px;
}
.form-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #9ca3af;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(67, 160, 71, 0.06);
  border: 1px solid rgba(67, 160, 71, 0.15);
  margin-bottom: 14px;
}
.form-note svg { width: 16px; height: 16px; color: var(--mint); flex-shrink: 0; margin-top: 2px; }
.reg-credentials {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(67, 160, 71, 0.25);
}
.credential-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}
.credential-row:last-child { border-bottom: none; }
.credential-row span { color: #9ca3af; }
.credential-row strong { color: #e5e7eb; font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; text-align: right; }

/* ---- App toast notifications ---- */
.uf-toast-host {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.uf-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(22, 38, 28, 0.97), rgba(14, 24, 18, 0.98));
  border: 1px solid rgba(67, 160, 71, 0.35);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(139, 195, 74, 0.08),
    0 0 32px rgba(67, 160, 71, 0.12);
  backdrop-filter: blur(14px);
  transform: translateX(28px);
  opacity: 0;
  animation: ufToastIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.uf-toast.is-leaving {
  animation: ufToastOut 0.28s ease forwards;
}
.uf-toast-success {
  border-color: rgba(67, 160, 71, 0.45);
}
.uf-toast-error {
  border-color: rgba(248, 113, 113, 0.4);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(248, 113, 113, 0.08);
}
.uf-toast-icon {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(67, 160, 71, 0.35), rgba(139, 195, 74, 0.18));
  color: var(--mint);
}
.uf-toast-error .uf-toast-icon {
  background: linear-gradient(145deg, rgba(248, 113, 113, 0.28), rgba(239, 68, 68, 0.12));
  color: #fca5a5;
}
.uf-toast-icon::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(139, 195, 74, 0.35);
  animation: ufToastRing 0.7s ease-out;
}
.uf-toast-error .uf-toast-icon::before {
  border-color: rgba(248, 113, 113, 0.35);
}
.uf-toast-icon svg {
  width: 20px;
  height: 20px;
}
.uf-toast-body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}
.uf-toast-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
  letter-spacing: 0.01em;
}
.uf-toast-message {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #b8c4bc;
}
.uf-toast-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, color 0.2s;
}
.uf-toast-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.uf-toast-close svg {
  width: 14px;
  height: 14px;
}
.uf-toast-progress {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: rgba(139, 195, 74, 0.25);
  overflow: hidden;
}
.uf-toast {
  position: relative;
  overflow: hidden;
}
.uf-toast-progress > span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(to right, var(--secondary, #1b5e20), var(--mint));
  animation: ufToastProgress linear forwards;
}
.uf-toast-error .uf-toast-progress > span {
  background: linear-gradient(to right, #ef4444, #f87171);
}
@keyframes ufToastIn {
  from { opacity: 0; transform: translateX(28px) translateY(-6px); }
  to { opacity: 1; transform: translateX(0) translateY(0); }
}
@keyframes ufToastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(24px); }
}
@keyframes ufToastRing {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes ufToastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
@media (max-width: 640px) {
  .uf-toast-host {
    top: auto;
    bottom: 20px;
    right: 16px;
    left: 16px;
    width: auto;
  }
  .uf-toast {
    transform: translateY(16px);
    animation-name: ufToastInMobile;
  }
  .uf-toast.is-leaving {
    animation-name: ufToastOutMobile;
  }
  @keyframes ufToastInMobile {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes ufToastOutMobile {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(12px); }
  }
}
