/**
 * EST Impact Platform — console UI (Bootstrap 5 extension)
 */
:root {
  --pf-navy: #0f172a;
  --pf-navy-mid: #1e293b;
  --pf-teal: #0c4a6e;
  --pf-teal-bright: #0369a1;
  --pf-orange: #e25419;
  --pf-orange-soft: #fff4f0;
  --pf-slate: #64748b;
  --pf-line: rgba(255, 255, 255, 0.08);
  --pf-sidebar-w: 17.5rem;
  --pf-radius: 0.75rem;
  --pf-radius-sm: 0.5rem;
  --pf-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --pf-shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.08);
  --pf-font: "DM Sans", system-ui, -apple-system, sans-serif;
  --pf-display: "Outfit", var(--pf-font);
}

.platform-app {
  font-family: var(--pf-font);
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(165deg, #f1f5f9 0%, #e8edf3 40%, #f8fafc 100%);
  color: var(--pf-navy);
}

.platform-shell {
  max-width: 100%;
}

/* Sidebar */
.platform-sidebar {
  width: 100%;
  background: linear-gradient(180deg, var(--pf-navy) 0%, #0c1222 55%, var(--pf-navy-mid) 100%);
  color: rgba(255, 255, 255, 0.88);
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.12);
  z-index: 1020;
}

@media (min-width: 992px) {
  .platform-sidebar {
    width: var(--pf-sidebar-w);
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
  }
}

.platform-sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1rem 0.8rem 1.25rem;
}

@media (min-width: 992px) {
  .platform-sidebar-inner {
    min-height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
  }
}

.platform-brand {
  padding: 0.35rem 0.65rem 1rem;
  border-bottom: 1px solid var(--pf-line);
  margin-bottom: 0.5rem;
}

.platform-brand__title {
  font-family: var(--pf-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: #fff;
  margin: 0;
}

.platform-brand__title span {
  color: #fb923c;
  font-weight: 600;
}

.platform-brand__user {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-brand__meta {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.58);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow-y: auto;
}

.platform-nav .nav-link {
  color: rgba(255, 255, 255, 0.72);
  border-radius: var(--pf-radius-sm);
  padding: 0.5rem 0.72rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.platform-nav .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.platform-nav .nav-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(226, 84, 25, 0.25), rgba(12, 74, 110, 0.35));
  border-color: rgba(251, 146, 60, 0.35);
  box-shadow: inset 3px 0 0 var(--pf-orange);
}

.platform-nav .badge {
  font-size: 0.65rem;
  font-weight: 700;
  vertical-align: middle;
}

.platform-sidebar-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pf-line);
}

.platform-sidebar-footer .nav-link {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.platform-sidebar-footer .btn-link {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 0.8rem;
}

.platform-sidebar-footer .btn-link:hover {
  color: #fb923c;
}

/* Top bar (enterprise context) */
.platform-topbar {
  position: sticky;
  top: 0;
  z-index: 1010;
}

.platform-mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 1025;
}

.platform-mobile-nav {
  --bs-offcanvas-width: min(86vw, 320px);
}

.platform-sidebar--mobile {
  min-height: 100%;
  box-shadow: none;
}

.platform-sidebar--mobile .platform-sidebar-inner {
  max-height: none;
  min-height: 100%;
}

.platform-topbar__label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.platform-role-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pf-teal);
  background: rgba(3, 105, 161, 0.08);
  border: 1px solid rgba(3, 105, 161, 0.2);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
}

.platform-nav-group__label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.42);
}

/* Main */
.platform-main {
  min-width: 0;
}

.platform-content {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Dashboard quick links */
.platform-quick-links {
  border: 1px solid rgba(12, 74, 110, 0.12) !important;
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 55%, #f1f5f9 100%);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.07) !important;
}

.platform-quick-links__head {
  background: linear-gradient(90deg, rgba(226, 84, 25, 0.06) 0%, transparent 40%), #fff !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
}

.platform-quick-links__badge {
  width: 0.5rem;
  height: 2.25rem;
  border-radius: 0.25rem;
  background: linear-gradient(180deg, var(--pf-teal-bright) 0%, var(--pf-orange) 100%);
  flex-shrink: 0;
}

.platform-quick-links__tile {
  border-color: rgba(15, 23, 42, 0.08) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.platform-quick-links__tile:hover {
  border-color: rgba(3, 105, 161, 0.22) !important;
  box-shadow: var(--pf-shadow);
}

/* Dashboard */
.platform-dashboard-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(130deg, #ffffff 0%, #f8fafc 55%, #eef5fb 100%);
  border: 1px solid rgba(3, 105, 161, 0.12);
  border-radius: 1rem;
  padding: 1.1rem 1.25rem 1.15rem;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.06);
}

.platform-dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--pf-teal-bright) 0%, var(--pf-teal) 45%, var(--pf-orange) 100%);
}

.platform-dashboard-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.platform-dashboard-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--pf-navy-mid);
  background: rgba(255, 255, 255, 0.92);
}

.platform-dashboard-stats .platform-stat {
  background: linear-gradient(170deg, #fff 0%, #f9fbfd 70%, #f4f8fc 100%);
  border-color: rgba(12, 74, 110, 0.1);
}

.platform-dashboard-panel {
  border: 1px solid rgba(15, 23, 42, 0.07) !important;
  box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.2) !important;
}

.platform-dashboard-panel .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.platform-dashboard-chart-wrap {
  background:
    radial-gradient(circle at 8% 0%, rgba(3, 105, 161, 0.06) 0%, transparent 35%),
    radial-gradient(circle at 95% 100%, rgba(226, 84, 25, 0.05) 0%, transparent 40%);
}

.platform-dashboard-status-list li:last-child {
  border-bottom: none !important;
}

/* Footer */
.platform-footer {
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.04);
}

.platform-footer__inner {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.platform-footer__nav a:hover {
  color: var(--pf-teal-bright) !important;
  text-decoration: underline !important;
}

.platform-footer__tagline {
  max-width: 42rem;
}

/* Page chrome */
.platform-page-head {
  margin-bottom: 1.75rem;
}

.platform-page-head__eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pf-teal);
  margin-bottom: 0.35rem;
}

.platform-page-head h1,
.platform-page-head .h1 {
  font-family: var(--pf-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  color: var(--pf-navy);
  letter-spacing: -0.02em;
  margin: 0;
}

.platform-page-head .lead,
.platform-page-head p.text-secondary {
  margin-top: 0.5rem;
  margin-bottom: 0;
  color: var(--pf-slate) !important;
  font-size: 0.95rem;
  max-width: 42rem;
}

/* Records listing pages */
.platform-listing-hero {
  border: 1px solid rgba(3, 105, 161, 0.12);
  background: linear-gradient(130deg, #ffffff 0%, #f8fafc 56%, #eef5fb 100%);
  border-radius: 1rem;
  padding: 1.2rem 1.3rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.platform-listing-hero__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--pf-teal);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.platform-filter-panel {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.9rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
  padding: 1rem 1.05rem;
}

.platform-filter-panel .form-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pf-slate);
  margin-bottom: 0.4rem;
}

.platform-filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.platform-filter-actions-wrap {
  display: flex;
  flex-direction: column;
}

.platform-filter-row .form-control,
.platform-filter-row .form-select {
  min-height: 2.45rem;
  border-radius: 0.55rem;
  background-color: #fff;
}

.platform-btn-control {
  min-height: 2.45rem;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 0.8rem;
}

@media (min-width: 768px) {
  .platform-filter-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }
}

.platform-listing-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.9rem;
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  padding: 1rem 1rem 0.95rem;
  display: flex;
  flex-direction: column;
}

.platform-listing-card__title {
  font-weight: 700;
  color: var(--pf-navy);
  line-height: 1.35;
  font-size: 1rem;
}

.platform-listing-card__stats {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.platform-listing-card__stats > div {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.6rem;
  padding: 0.5rem 0.6rem;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.platform-listing-card__stats span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pf-slate);
  font-weight: 700;
}

.platform-listing-card__stats strong {
  font-size: 1rem;
  font-family: var(--pf-display);
}

/* Cards */
.platform-app .card {
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: var(--pf-radius);
  box-shadow: var(--pf-shadow);
  overflow: hidden;
  background: #fff;
}

.platform-app .card-header {
  font-family: var(--pf-display);
  font-weight: 600;
  font-size: 0.9rem;
  background: linear-gradient(180deg, #fafbfc 0%, #f4f6f9 100%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--pf-navy);
  padding: 0.75rem 1.1rem;
}

.platform-app .table {
  --bs-table-hover-bg: rgba(12, 74, 110, 0.04);
}

.platform-app .table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pf-slate);
  border-bottom-width: 1px;
  background: #fafbfc;
}

/* Wide table horizontal scrolling */
.platform-horizontal-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
}

.platform-horizontal-scroll-hint {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.platform-horizontal-scroll::-webkit-scrollbar {
  height: 10px;
}

.platform-horizontal-scroll::-webkit-scrollbar-track {
  background: #edf2f7;
}

.platform-horizontal-scroll::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
}

.platform-horizontal-scroll::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

@media (max-width: 767.98px) {
  .platform-listing-hero {
    padding: 0.85rem 0.85rem;
  }

  .platform-listing-hero .h3 {
    font-size: 1.18rem;
  }

  .platform-listing-actions {
    width: 100%;
  }

  .platform-listing-actions .btn {
    flex: 1 1 0;
    min-width: 0;
  }

  .platform-filter-panel {
    padding: 0.8rem 0.8rem;
  }

  .platform-filter-actions {
    width: 100%;
    justify-content: stretch;
  }

  .platform-filter-actions .btn,
  .platform-filter-actions .btn-group {
    width: 100%;
  }

  .platform-filter-actions .btn-group .btn {
    width: 50%;
  }

  .platform-horizontal-scroll-hint {
    font-size: 0.72rem;
  }

  .platform-horizontal-scroll table {
    min-width: 720px;
  }

  .platform-nav-group {
    margin-bottom: 0.75rem !important;
  }
}

/* Stat tiles (dashboard) */
.platform-stat {
  border-radius: var(--pf-radius);
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
  box-shadow: var(--pf-shadow);
  padding: 1.1rem 1.15rem;
  height: 100%;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.platform-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: var(--stat-accent, var(--pf-teal));
}

.platform-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--pf-shadow-lg);
}

.platform-stat__label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pf-slate);
  margin-bottom: 0.35rem;
}

.platform-stat__value {
  font-family: var(--pf-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--pf-navy);
  letter-spacing: -0.03em;
}

.platform-stat--programs {
  --stat-accent: #0c4a6e;
}
.platform-stat--beneficiaries {
  --stat-accent: #0369a1;
}
.platform-stat--records {
  --stat-accent: #e25419;
}
.platform-stat--review {
  --stat-accent: #d97706;
}
.platform-stat--approved {
  --stat-accent: #059669;
}
.platform-stat--rejected {
  --stat-accent: #dc2626;
}

.platform-stat--draft {
  --stat-accent: #7c3aed;
}

/* Buttons — primary aligns with brand */
.platform-app .btn-primary {
  --bs-btn-bg: var(--pf-orange);
  --bs-btn-border-color: var(--pf-orange);
  --bs-btn-hover-bg: #ea5f25;
  --bs-btn-hover-border-color: #ea5f25;
  --bs-btn-active-bg: #c74715;
  --bs-btn-active-border-color: #c74715;
  font-weight: 600;
  border-radius: var(--pf-radius-sm);
  padding: 0.45rem 1rem;
}

.platform-app .btn-outline-primary {
  --bs-btn-color: var(--pf-teal);
  --bs-btn-border-color: var(--pf-teal);
  --bs-btn-hover-bg: var(--pf-teal);
  --bs-btn-hover-border-color: var(--pf-teal);
  font-weight: 600;
  border-radius: var(--pf-radius-sm);
}

.platform-app .btn-outline-secondary {
  border-radius: var(--pf-radius-sm);
  font-weight: 500;
}

/* Alerts */
.platform-app .alert-success {
  border: none;
  border-radius: var(--pf-radius-sm);
  border-left: 4px solid #059669;
  background: #ecfdf5;
  color: #065f46;
}

.platform-app .alert-danger {
  border: none;
  border-radius: var(--pf-radius-sm);
  border-left: 4px solid #dc2626;
  background: #fef2f2;
}

/* Forms */
.platform-app .form-control,
.platform-app .form-select {
  border-radius: var(--pf-radius-sm);
  border-color: #cbd5e1;
}

.platform-app .form-control:focus,
.platform-app .form-select:focus {
  border-color: var(--pf-teal-bright);
  box-shadow: 0 0 0 0.2rem rgba(12, 74, 110, 0.12);
}

/* Product / prose */
.platform-prose {
  background: #fff;
  border-radius: var(--pf-radius);
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: var(--pf-shadow);
  padding: 1.75rem 1.75rem 1.5rem;
}

.platform-prose ul {
  padding-left: 1.2rem;
  color: var(--pf-slate);
}

.platform-prose ul li {
  margin-bottom: 0.5rem;
  line-height: 1.55;
}

/* Public landing (pre-login) */
.platform-landing {
  min-height: 100vh;
  background: linear-gradient(145deg, #0f172a 0%, #0c4a6e 45%, #1e293b 100%);
  font-family: var(--pf-font);
}

.platform-landing__panel {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 1rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.platform-landing h1 {
  font-family: var(--pf-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--pf-navy);
}

.platform-landing .lead {
  color: var(--pf-slate);
}

.platform-landing .btn-primary {
  --bs-btn-bg: var(--pf-orange);
  --bs-btn-border-color: var(--pf-orange);
  --bs-btn-hover-bg: #ea5f25;
  --bs-btn-hover-border-color: #ea5f25;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border-radius: var(--pf-radius-sm);
}

.platform-landing .btn-outline-secondary {
  font-weight: 600;
  border-radius: var(--pf-radius-sm);
}

/* Auth (login / register / password) */
.platform-auth-page {
  font-family: var(--pf-font);
  -webkit-font-smoothing: antialiased;
  color: var(--pf-navy);
  background-color: #e8edf3;
  background-image:
    radial-gradient(ellipse 100% 80% at 100% -10%, rgba(3, 105, 161, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 90% 70% at -5% 105%, rgba(226, 84, 25, 0.09) 0%, transparent 50%),
    linear-gradient(165deg, #f8fafc 0%, #f1f5f9 42%, #e8edf3 100%);
  background-attachment: fixed;
}

@media (max-width: 991.98px) {
  .platform-auth-page {
    background-attachment: scroll;
  }
}

.platform-auth-grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 992px) {
  .platform-auth-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  }
}

.platform-auth-brand {
  background: linear-gradient(155deg, #0f172a 0%, #0c4a6e 42%, #1e293b 100%);
  color: rgba(255, 255, 255, 0.92);
  padding: clamp(1.75rem, 5vw, 2.5rem) clamp(1.5rem, 4vw, 2.25rem) clamp(1.5rem, 4vw, 2rem);
  position: relative;
  overflow: hidden;
}

.platform-auth-brand::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(226, 84, 25, 0.18) 0%, transparent 65%);
  pointer-events: none;
}

.platform-auth-brand::after {
  content: "";
  position: absolute;
  inset: auto -30% -35% auto;
  width: 55%;
  height: 55%;
  background: radial-gradient(circle, rgba(3, 105, 161, 0.14) 0%, transparent 60%);
  pointer-events: none;
}

.platform-auth-brand > * {
  position: relative;
  z-index: 1;
}

.platform-auth-brand-link {
  color: inherit;
}

.platform-auth-brand-link:hover {
  color: #fff;
}

.platform-auth-logo-wrap {
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--pf-radius);
  padding: 0.85rem 1.1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: inline-block;
  line-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.platform-auth-logo-wrap--sm {
  padding: 0.65rem 0.9rem;
}

.platform-auth-logo {
  max-width: 100%;
  height: auto;
  display: block;
}

.platform-auth-eyebrow {
  letter-spacing: 0.14em;
  color: rgba(251, 146, 60, 0.95);
}

.platform-auth-brand-title {
  font-family: var(--pf-display);
  font-weight: 800;
  font-size: clamp(1.65rem, 2.5vw, 2.15rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.platform-auth-brand-title span {
  color: #fb923c;
  font-weight: 700;
}

.platform-auth-brand-lead {
  font-size: 0.98rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
  max-width: 28rem;
}

.platform-auth-brand-foot {
  color: rgba(255, 255, 255, 0.45);
}

.platform-auth-main {
  min-height: 100vh;
  min-height: 100dvh;
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
}

.platform-auth-card {
  --auth-pad-x: 1.25rem;
  position: relative;
  max-width: 420px;
  background: #fff;
  border-radius: 1rem;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 20px 50px -12px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.65);
  padding: 1.5rem var(--auth-pad-x) 1.65rem;
  overflow: hidden;
}

.platform-auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pf-teal-bright) 0%, var(--pf-teal) 38%, var(--pf-orange) 100%);
  opacity: 0.95;
}

@media (min-width: 576px) {
  .platform-auth-card {
    --auth-pad-x: 2rem;
    padding: 2rem var(--auth-pad-x) 2.15rem;
    border-radius: 1.125rem;
  }
}

.platform-auth-card--wide {
  max-width: 460px;
}

.platform-auth-mobile-brand {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.platform-auth-mobile-brand-link {
  display: flex;
  justify-content: center;
  align-items: center;
  color: inherit;
  border-radius: var(--pf-radius);
  padding: 0.35rem 0.5rem;
  margin: -0.35rem -0.5rem;
  transition: background 0.15s ease;
}

.platform-auth-mobile-brand-link:hover {
  background: rgba(3, 105, 161, 0.04);
}

.platform-auth-mobile-brand-link:focus-visible {
  outline: 2px solid rgba(3, 105, 161, 0.45);
  outline-offset: 2px;
}

.platform-auth-mobile-brand-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  width: 100%;
  max-width: 17.5rem;
  margin-inline: auto;
  text-align: center;
}

.platform-auth-mobile-brand-inner .platform-auth-logo-wrap {
  flex-shrink: 0;
  margin: 0;
}

.platform-auth-mobile-title-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  line-height: 1.25;
}

.platform-auth-mobile-title-line {
  font-family: var(--pf-display);
  font-weight: 800;
  font-size: clamp(1.05rem, 3.2vw, 1.2rem);
  letter-spacing: -0.02em;
  color: var(--pf-navy);
  display: block;
  width: 100%;
}

.platform-auth-mobile-title-line--accent {
  color: var(--pf-orange);
  font-size: clamp(0.98rem, 3vw, 1.1rem);
  font-weight: 700;
}

.platform-auth-form-head {
  text-align: start;
}

.platform-auth-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pf-teal-bright);
  margin: 0;
}

.platform-auth-sublead {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--pf-slate);
  max-width: 26rem;
}

.platform-auth-heading {
  font-family: var(--pf-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--pf-navy);
  line-height: 1.2;
}

.platform-auth-heading.h3 {
  font-size: clamp(1.2rem, 4vw, 1.35rem);
}

.platform-auth-form .form-label {
  color: var(--pf-navy-mid);
  margin-bottom: 0.4rem;
}

.platform-auth-form .form-control-lg {
  font-size: 0.95rem;
  padding: 0.7rem 1rem;
  border-radius: 0.625rem;
  border-color: rgba(15, 23, 42, 0.1);
  background-color: #fafbfc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.platform-auth-form .form-control-lg:hover:not(:focus):not(:disabled) {
  border-color: rgba(15, 23, 42, 0.16);
}

.platform-auth-form .form-control:focus {
  background-color: #fff;
  border-color: var(--pf-teal-bright);
  box-shadow: 0 0 0 0.2rem rgba(3, 105, 161, 0.14);
}

.platform-auth-form .form-control-lg::placeholder {
  color: #94a3b8;
}

.platform-auth-link {
  color: var(--pf-teal-bright);
  text-decoration: none;
  transition: color 0.15s ease;
}

.platform-auth-link:hover {
  color: var(--pf-teal);
  text-decoration: underline;
}

.platform-auth-page .btn-primary.platform-auth-submit,
.platform-auth-page .btn-primary {
  --bs-btn-bg: var(--pf-orange);
  --bs-btn-border-color: var(--pf-orange);
  --bs-btn-hover-bg: #ea5f25;
  --bs-btn-hover-border-color: #ea5f25;
  --bs-btn-active-bg: #c94a15;
  --bs-btn-active-border-color: #c94a15;
  font-weight: 600;
  border-radius: 0.625rem;
  padding: 0.7rem 1.25rem;
  box-shadow: 0 4px 14px rgba(226, 84, 25, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.platform-auth-page .btn-primary.platform-auth-submit:hover,
.platform-auth-page .btn-primary:hover {
  box-shadow: 0 6px 20px rgba(226, 84, 25, 0.34);
  transform: translateY(-1px);
}

.platform-auth-page .btn-primary.platform-auth-submit:active,
.platform-auth-page .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(226, 84, 25, 0.25);
}

.platform-auth-page .alert {
  border-radius: 0.625rem;
}

.platform-auth-page .form-check-input {
  border-color: rgba(15, 23, 42, 0.2);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.platform-auth-page .form-check-input:focus {
  border-color: var(--pf-teal-bright);
  box-shadow: 0 0 0 0.2rem rgba(3, 105, 161, 0.12);
}

.platform-auth-page .form-check-input:checked {
  background-color: var(--pf-orange);
  border-color: var(--pf-orange);
}

@media (prefers-reduced-motion: reduce) {
  .platform-auth-form .form-control-lg,
  .platform-auth-page .btn-primary.platform-auth-submit,
  .platform-auth-page .btn-primary,
  .platform-auth-link,
  .platform-auth-mobile-brand-link {
    transition: none;
  }

  .platform-auth-page .btn-primary.platform-auth-submit:hover,
  .platform-auth-page .btn-primary:hover {
    transform: none;
  }
}

/* Form builder (dynamic forms) — friendly UX */
.platform-form-builder {
  max-width: 52rem;
}

.platform-form-builder__intro {
  border-radius: var(--pf-radius);
  border: 1px solid rgba(3, 105, 161, 0.2);
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.95) 0%, rgba(224, 242, 254, 0.35) 100%);
}

.platform-form-builder__steps {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--pf-navy-mid);
  font-size: 0.9rem;
  line-height: 1.55;
}

.platform-form-builder__steps li {
  margin-bottom: 0.35rem;
}

.platform-form-builder__section {
  border-radius: var(--pf-radius);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-left: 4px solid var(--pf-orange);
  overflow: hidden;
}

.platform-form-builder__section-head {
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.platform-form-builder__field {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--pf-radius-sm);
  padding: 1rem 1rem 0.85rem;
}

.platform-form-builder__field + .platform-form-builder__field {
  margin-top: 0.75rem;
}

.platform-form-builder__hint {
  font-size: 0.8125rem;
  color: var(--pf-slate);
  line-height: 1.45;
}

.platform-form-builder__options-wrap.is-hidden {
  display: none;
}

.platform-form-builder__add-field {
  border: 2px dashed rgba(15, 23, 42, 0.12);
  border-radius: var(--pf-radius-sm);
  background: #fff;
  padding: 1rem;
  margin-top: 1rem;
}

.platform-form-builder__pill {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pf-slate);
  background: rgba(15, 23, 42, 0.06);
  padding: 0.2rem 0.45rem;
  border-radius: 0.25rem;
}

/* Quick visual builder (survey-style) */
.gf-builder {
  max-width: 44rem;
  margin: 0 auto;
}

.gf-builder__title {
  font-family: var(--pf-display, inherit);
  letter-spacing: -0.02em;
}

.gf-builder__sticky-actions {
  position: sticky;
  top: 0.65rem;
  z-index: 1005;
  backdrop-filter: saturate(1.2) blur(2px);
  background: rgba(255, 255, 255, 0.95);
}

.gf-builder__sheet {
  border-radius: var(--pf-radius);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  overflow: hidden;
}

.gf-builder__sheet-inner {
  padding: 1.25rem 1.35rem;
  border-top: 4px solid #5b21b6;
}

.gf-builder__form-title-input {
  font-family: var(--pf-display, inherit);
  font-weight: 600;
  letter-spacing: -0.02em;
  border: none;
  border-bottom: 2px solid rgba(91, 33, 182, 0.35);
  border-radius: 0;
  padding-left: 0;
}

.gf-builder__form-title-input:focus {
  box-shadow: none;
  border-bottom-color: #5b21b6;
}

.gf-section-block__head {
  background: linear-gradient(180deg, #fafafa 0%, #f1f5f9 100%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.gf-section-title-input {
  max-width: 22rem;
  font-weight: 600;
}

.gf-drag {
  cursor: grab;
  user-select: none;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.45;
  padding: 0.15rem 0.25rem;
}

.gf-drag:active {
  cursor: grabbing;
}

.gf-field-card__inner {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--pf-radius-sm);
  background: #fff;
  padding: 0.85rem 0.75rem 0.65rem;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.gf-field-card__inner:focus-within {
  border-color: rgba(91, 33, 182, 0.45);
  box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.12);
}

.gf-field-label-input {
  font-weight: 500;
  font-size: 1rem;
}

.gf-mock-input {
  pointer-events: none;
}

.gf-mock-radio {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.gf-mock-check {
  vertical-align: middle;
}

.gf-add-toolbar {
  border-radius: var(--pf-radius);
  border: 1px dashed rgba(91, 33, 182, 0.35) !important;
  background: linear-gradient(135deg, rgba(250, 245, 255, 0.6) 0%, #fff 100%);
}

.sortable-ghost .gf-field-card__inner,
.sortable-ghost.gf-section-block {
  opacity: 0.55;
}

.sortable-drag .gf-field-card__inner {
  box-shadow: var(--pf-shadow-lg);
}

@media (max-width: 991.98px) {
  .gf-builder__sticky-actions {
    position: static;
  }
}
