:root {
  --m2-bg: #e9f0f6;
  --m2-surface: #ffffff;
  --m2-surface-soft: #f6f9fc;
  --m2-border: #d7e1ec;
  --m2-border-strong: #bfd0dd;
  --m2-text: #17212f;
  --m2-muted: #637083;
  --m2-accent: #155e75;
  --m2-accent-strong: #0f5268;
  --m2-accent-soft: #dff7f5;
  --m2-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --m2-radius: 12px;
}

html {
  min-height: 100%;
  font-size: 15px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 10%, rgba(21, 94, 117, 0.12), transparent 28rem),
    linear-gradient(135deg, #f8fbfd 0%, var(--m2-bg) 46%, #dde8f0 100%);
  color: var(--m2-text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a {
  color: var(--m2-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--m2-accent-strong);
}

.app-container {
  max-width: 1180px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(191, 208, 221, 0.72);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
}

.navbar {
  min-height: 64px;
  padding: 0;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--m2-text);
  font-size: 1rem;
  font-weight: 720;
  letter-spacing: 0;
}

.brand-lockup:hover {
  color: var(--m2-text);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--m2-accent);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(21, 94, 117, 0.26);
}

.navbar-nav {
  gap: 4px;
}

.navbar .nav-link {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--m2-muted) !important;
  font-size: 0.92rem;
  font-weight: 560;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  background: var(--m2-surface-soft);
  color: var(--m2-text) !important;
}

.nav-logout-form {
  margin: 0;
}

.nav-logout-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.navbar-toggler {
  border-color: var(--m2-border);
  border-radius: 8px;
  width: 42px;
  height: 38px;
  padding: 0;
  background: rgba(255, 255, 255, 0.74);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(21, 94, 117, 0.14);
}

.navbar-toggler-line {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: var(--m2-accent);
}

.site-main {
  min-height: calc(100vh - 128px);
  padding: 28px 0 56px;
}

.footer {
  margin-top: auto;
  padding: clamp(30px, 4vw, 46px) 0 20px;
  border-top: 1px solid rgba(191, 208, 221, 0.72);
  color: var(--m2-muted);
  font-size: 0.92rem;
  text-align: left;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(320px, 1fr);
  column-gap: clamp(32px, 6vw, 86px);
  row-gap: clamp(14px, 2vw, 22px);
}

.footer-brand {
  display: grid;
  align-content: start;
  gap: 18px;
}

.footer-lockup {
  width: fit-content;
  text-decoration: none;
}

.footer-brand p {
  max-width: 330px;
  margin: 0;
  color: var(--m2-muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 5vw, 64px);
}

.footer-nav div {
  display: grid;
  align-content: start;
  gap: 10px;
}

.footer-nav h2 {
  margin: 0 0 4px;
  color: var(--m2-muted);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-nav a {
  width: fit-content;
  color: var(--m2-ink-soft);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.footer-nav a:hover,
.footer-nav a:focus {
  color: var(--m2-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-bottom {
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(18px, 3vw, 28px);
  padding-top: 18px;
  border-top: 1px solid rgba(191, 208, 221, 0.72);
  color: var(--m2-muted);
  font-size: 0.86rem;
}

@media (max-width: 991.98px) {
  .site-header {
    position: sticky;
  }

  .navbar {
    min-height: 58px;
    padding: 8px 0;
  }

  .navbar > .app-container {
    align-items: center;
  }

  .brand-lockup {
    min-width: 0;
    max-width: calc(100vw - 112px);
    font-size: 0.96rem;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }

  .navbar-collapse {
    flex-basis: 100%;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid rgba(191, 208, 221, 0.9);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
  }

  .navbar-nav {
    gap: 4px;
    width: 100%;
  }

  .navbar .nav-link,
  .nav-logout-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    border-radius: 9px;
    text-align: left;
    white-space: nowrap;
  }

  .navbar .nav-cta {
    justify-content: center;
    margin-top: 6px;
    border: 1px solid rgba(21, 94, 117, 0.22);
    background: var(--m2-accent-soft);
    color: var(--m2-accent-strong) !important;
  }

  .account-link {
    align-items: center;
  }

  .account-copy {
    min-width: 0;
  }

  .account-copy span,
  .account-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  .app-container {
    padding-right: 12px;
    padding-left: 12px;
  }

  .brand-lockup {
    gap: 8px;
    font-size: 0.9rem;
  }
}

.home-panel,
.billing-panel,
.auth-panel,
.site-main > form,
.site-main > .row {
  border: 1px solid var(--m2-border);
  border-radius: var(--m2-radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--m2-shadow);
}

.home-panel,
.billing-panel,
.auth-panel {
  max-width: 760px;
  margin: 68px auto;
  padding: clamp(24px, 5vw, 42px);
}

.home-panel h1,
.billing-panel h1,
.auth-panel h1,
.site-main h1 {
  max-width: 680px;
  margin: 0 0 12px;
  color: var(--m2-text);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.05;
}

.home-panel p,
.billing-panel p,
.auth-panel p,
.site-main p {
  color: var(--m2-muted);
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--m2-accent);
  font-size: 0.75rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 650;
  box-shadow: none !important;
}

.btn-primary,
.btn-primary:focus {
  border-color: var(--m2-accent);
  background: var(--m2-accent);
}

.btn-primary:hover {
  border-color: var(--m2-accent-strong);
  background: var(--m2-accent-strong);
}

.btn-outline-secondary {
  border-color: var(--m2-border-strong);
  color: var(--m2-text);
  background: #ffffff;
}

.btn-outline-secondary:hover {
  border-color: var(--m2-accent);
  background: var(--m2-accent-soft);
  color: var(--m2-text);
}

.form-control,
.form-check-input {
  border-color: var(--m2-border);
  border-radius: 8px;
  color: var(--m2-text);
}

.form-control {
  min-height: 46px;
  background: #ffffff;
}

.form-control:focus,
.form-check-input:focus {
  border-color: var(--m2-accent);
  box-shadow: 0 0 0 3px rgba(21, 94, 117, 0.14);
}

.form-check-input:checked {
  border-color: var(--m2-accent);
  background-color: var(--m2-accent);
}

.text-danger,
.validation-summary-errors {
  color: #b42318 !important;
}

.validation-summary {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: 10px;
  background: rgba(254, 243, 242, 0.82);
  font-size: 0.9rem;
}

.validation-summary:empty,
.validation-summary.validation-summary-valid,
.validation-summary:not(.validation-summary-errors),
.validation-summary:has(> ul:empty) {
  display: none;
}

.validation-summary ul {
  margin: 0;
  padding-left: 18px;
}

.field-validation-valid {
  display: none;
}

.site-main > .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.56fr);
  gap: 0;
  max-width: 1040px;
  margin: 34px auto 0;
  overflow: hidden;
}

.site-main > .row::before {
  content: "m2";
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.site-main > .row > [class*="col-"] {
  width: auto;
  max-width: none;
  padding: clamp(24px, 4vw, 40px);
}

.site-main > .row > [class*="col-"]:first-child {
  background: #ffffff;
}

.site-main > .row > [class*="col-"]:last-child {
  border-left: 1px solid var(--m2-border);
  background:
    linear-gradient(180deg, rgba(21, 94, 117, 0.08), transparent),
    var(--m2-surface-soft);
}

.site-main > .row h1 {
  grid-column: 1 / -1;
}

.site-main h2,
.site-main h3 {
  margin-bottom: 14px;
  color: var(--m2-text);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 700;
  letter-spacing: 0;
}

.site-main hr {
  margin: 14px 0 20px;
  border-color: var(--m2-border-strong);
  opacity: 1;
}

.site-main form {
  display: grid;
  gap: 14px;
}

.auth-panel {
  max-width: 560px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--m2-text);
  font-size: 0.92rem;
  font-weight: 640;
}

.field .text-danger {
  font-size: 0.84rem;
  font-weight: 520;
}

.auth-alt {
  margin: 18px 0 0;
  font-size: 0.94rem;
}

.site-main .form-floating {
  margin-bottom: 0 !important;
}

.site-main .form-floating > label {
  color: var(--m2-muted);
}

.site-main .form-floating > .form-control::placeholder {
  color: transparent;
}

.site-main .checkbox {
  margin: 2px 0 8px;
}

.site-main #login-submit,
.site-main #registerSubmit {
  width: 100%;
  margin-top: 4px;
}

.site-main form + p,
.site-main form ~ p {
  margin: 4px 0;
  font-size: 0.92rem;
}

.site-main > .row section > p:has(a[href*="external"]),
.site-main > .row section > p:has(a[href*="External"]) {
  display: none;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

@media (max-width: 900px) {
  .site-main > .row {
    grid-template-columns: 1fr;
  }

  .site-main > .row > [class*="col-"]:last-child {
    border-left: 0;
    border-top: 1px solid var(--m2-border);
  }
}

@media (max-width: 640px) {
  .footer {
    padding-top: 34px;
  }

  .footer-nav {
    grid-template-columns: 1fr;
  }

  .site-main {
    padding-top: 16px;
  }

  .home-panel,
  .billing-panel,
  .site-main > .row {
    margin-top: 18px;
  }

  .navbar-collapse {
    padding: 10px 0 14px;
  }
}

/* ============================================================
   Vector server shell
   ============================================================ */
body::before {
  content: "";
  position: fixed;
  inset: 64px 0 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(21, 94, 117, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 94, 117, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
  pointer-events: none;
}

.site-header {
  border-bottom: 1px solid rgba(191, 208, 221, 0.58);
  background: rgba(252, 254, 255, 0.84);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
}

.navbar .app-container {
  gap: 22px;
}

.brand-lockup {
  gap: 12px;
  font-size: 0.98rem;
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(14, 165, 183, 0.88), rgba(15, 82, 104, 1));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 14px 30px rgba(21, 94, 117, 0.26);
}

.navbar-collapse {
  align-items: center;
}

.navbar-nav {
  align-items: center;
  gap: 6px;
}

.navbar .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid transparent;
  color: #516075 !important;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  border-color: rgba(191, 208, 221, 0.78);
  background: rgba(255, 255, 255, 0.72);
  color: var(--m2-text) !important;
}

.nav-cta {
  border-color: rgba(21, 94, 117, 0.2) !important;
  background: var(--m2-accent-soft);
  color: var(--m2-accent-strong) !important;
}

.account-link {
  padding: 5px 10px 5px 6px !important;
  border-color: rgba(191, 208, 221, 0.72) !important;
  background: rgba(255, 255, 255, 0.72);
}

.account-copy {
  display: grid;
  gap: 1px;
  line-height: 1.05;
}

.account-copy small {
  color: var(--m2-muted);
  font-size: 0.66rem;
  font-weight: 650;
}

.account-avatar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #17212f;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 780;
}

@media (max-width: 991.98px) {
  .navbar-collapse {
    align-items: stretch;
  }

  .navbar-nav {
    align-items: stretch;
  }

  .navbar .nav-link,
  .nav-logout-button {
    justify-content: flex-start;
    width: 100%;
  }

  .navbar .account-link {
    width: 100%;
    min-height: 42px;
    padding: 8px 10px !important;
  }

  .navbar .nav-cta {
    padding: 9px 12px !important;
  }
}

.site-main {
  position: relative;
  display: grid;
  align-items: start;
  min-height: calc(100vh - 132px);
}

.billing-panel,
.auth-panel,
.home-panel {
  position: relative;
  width: min(920px, 100%);
  max-width: none;
  margin: clamp(42px, 8vh, 86px) auto;
  padding: clamp(30px, 5vw, 56px);
  overflow: hidden;
  border: 1px solid rgba(191, 208, 221, 0.78);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 252, 0.92)),
    #ffffff;
  box-shadow:
    0 36px 90px rgba(15, 23, 42, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.billing-panel-subscription {
  padding-right: clamp(30px, 32vw, 390px);
}

.auth-panel {
  width: min(760px, 100%);
  padding-right: clamp(30px, 5vw, 56px);
  background:
    radial-gradient(360px 240px at 82% 10%, rgba(14, 165, 183, 0.25), transparent 65%),
    linear-gradient(145deg, rgba(225, 247, 250, 0.78), rgba(255, 255, 255, 0.92) 58%);
}

.billing-panel::before,
.auth-panel::before,
.home-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 5px solid var(--m2-accent);
  pointer-events: none;
}

.billing-panel::after {
  content: "";
  position: absolute;
  right: clamp(18px, 4vw, 46px);
  top: 50%;
  width: min(32vw, 340px);
  aspect-ratio: 16 / 10;
  transform: translateY(-50%);
  overflow: hidden;
  border: 1px solid rgba(151, 180, 199, 0.38);
  border-top: 5px solid var(--m2-accent);
  border-radius: 20px;
  background:
    linear-gradient(rgba(226, 242, 247, 0.16), rgba(226, 242, 247, 0.16)),
    url("/images/forma/forma-bim2-cropped.png") center / cover no-repeat,
    #d8e6ef;
  box-shadow: 0 24px 52px rgba(15, 43, 62, 0.14);
  opacity: 0.98;
  pointer-events: none;
}

.auth-panel::after {
  content: none;
}

.billing-panel > *,
.auth-panel > *,
.home-panel > * {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.billing-panel h1,
.auth-panel h1,
.home-panel h1,
.site-main h1 {
  max-width: 560px;
  margin-bottom: 14px;
  font-size: clamp(2.15rem, 4.2vw, 4rem);
  font-weight: 790;
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.billing-panel p,
.auth-panel p,
.home-panel p {
  max-width: 520px;
  font-size: 1.02rem;
  line-height: 1.62;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--m2-accent-strong);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.14em;
}

.eyebrow::before {
  content: none;
}

.billing-actions {
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 720;
  text-decoration: none;
}

.btn-primary,
.btn-primary:focus {
  border-color: transparent;
  background:
    linear-gradient(145deg, var(--m2-accent), var(--m2-accent-strong));
  box-shadow: 0 14px 26px rgba(21, 94, 117, 0.24) !important;
}

.btn-primary:hover {
  transform: translateY(-1px);
  border-color: transparent;
  background:
    linear-gradient(145deg, var(--m2-accent-strong), #0b4152);
}

.btn-outline-secondary {
  border-color: rgba(191, 208, 221, 0.9);
  background: rgba(255, 255, 255, 0.76);
}

.auth-panel form,
.site-main form {
  gap: 16px;
}

.auth-panel form {
  max-width: 520px;
}

.auth-panel form .btn {
  width: auto;
}

.auth-panel form .btn-primary {
  min-width: 160px;
}

.auth-actions-form {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px !important;
  margin-top: 28px;
}

.auth-message {
  max-width: 520px;
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid rgba(21, 94, 117, 0.22);
  border-radius: 12px;
  background: rgba(224, 242, 254, 0.72);
  color: var(--m2-text);
  font-size: 0.95rem;
  line-height: 1.55;
}

.field {
  gap: 7px;
  font-weight: 670;
}

.form-control {
  min-height: 50px;
  border-color: rgba(191, 208, 221, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.form-control:focus {
  background: #ffffff;
}

.auth-alt {
  margin-top: 22px;
}

.site-footer {
  background:
    radial-gradient(680px 260px at 15% 0%, rgba(14, 165, 183, 0.08), transparent 62%),
    rgba(252, 254, 255, 0.74);
  backdrop-filter: blur(12px);
}

@media (max-width: 820px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .billing-panel::after,
  .auth-panel::after {
    display: none;
  }

  .billing-panel,
  .auth-panel,
  .home-panel {
    width: 100%;
  }

  .billing-panel-subscription {
    padding-right: clamp(30px, 5vw, 56px);
  }
}
