:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #08111f;
  color: #f7f9fc;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0, rgba(64, 111, 159, .22), transparent 34rem),
    radial-gradient(circle at 92% 15%, rgba(181, 210, 52, .10), transparent 26rem),
    #08111f;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.page-shell {
  width: min(74rem, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.25rem clamp(1rem, 4vw, 3rem) 1.5rem;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header {
  min-height: 4.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: #fff;
  text-decoration: none;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.05rem; letter-spacing: .015em; }
.brand small { margin-top: .1rem; color: #91a5bb; font-size: .76rem; }

.brand-mark {
  width: 2.55rem;
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid rgba(181, 210, 52, .45);
  border-radius: .8rem;
  background: linear-gradient(145deg, rgba(181, 210, 52, .18), rgba(181, 210, 52, .03));
  transform: rotate(45deg);
}

.brand-mark::before, .brand-mark::after, .brand-mark span {
  content: "";
  position: absolute;
  width: .38rem;
  height: .38rem;
  border-radius: 50%;
  background: #b5d234;
  box-shadow: 0 0 1rem rgba(181, 210, 52, .65);
}
.brand-mark::before { transform: translate(-.62rem, -.62rem); }
.brand-mark::after { transform: translate(.62rem, .62rem); }
.brand-mark span { transform: translate(.62rem, -.62rem); }

.user-control { min-height: 2.5rem; }

.portal-card {
  align-self: center;
  width: min(42rem, 100%);
  margin: clamp(2rem, 7vh, 5rem) auto;
  padding: clamp(1.4rem, 5vw, 3.25rem);
  border: 1px solid rgba(104, 139, 174, .38);
  border-radius: 1.5rem;
  background: linear-gradient(150deg, rgba(18, 37, 60, .97), rgba(11, 25, 43, .97));
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, .35);
}

.portal-card.wide { width: min(52rem, 100%); }
.hero-copy { margin-bottom: 2rem; }
.eyebrow, .label {
  margin: 0 0 .55rem;
  color: #b5d234;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: .9rem; font-size: clamp(2.2rem, 8vw, 4rem); line-height: .98; letter-spacing: -.045em; }
h2 { margin-bottom: .35rem; font-size: 1.18rem; }
.lede { max-width: 36rem; margin-bottom: 0; color: #b9c8d8; font-size: 1.05rem; line-height: 1.65; }
.subtle, .field-help, .panel-heading p, .state-panel p { color: #91a5bb; line-height: 1.55; }
.subtle, .field-help, .panel-heading p, .state-panel p { margin-bottom: 0; }

.state-panel, .account-panel, .crm-panel, .invite-panel, .confirmation {
  border: 1px solid rgba(104, 139, 174, .32);
  border-radius: 1rem;
  background: rgba(5, 16, 30, .48);
}

.state-panel {
  min-height: 5.25rem;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  gap: .9rem;
}
.state-panel strong { display: block; margin-bottom: .25rem; }
.state-panel.error { border-color: rgba(243, 123, 116, .5); }

.loader {
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 auto;
  border: .18rem solid rgba(181, 210, 52, .18);
  border-top-color: #b5d234;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.account-panel { padding: clamp(1rem, 4vw, 1.5rem); }
.panel-heading { display: flex; align-items: flex-start; gap: .9rem; }
.status-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: rgba(145, 165, 187, .14);
  color: #d5deea;
  font-weight: 900;
}
.status-icon.success { background: rgba(181, 210, 52, .13); color: #c8e35c; }

.field { margin-top: 1.4rem; }
label { display: block; margin-bottom: .45rem; color: #dfe7f1; font-size: .84rem; font-weight: 750; }
input, select {
  width: 100%;
  min-height: 3rem;
  padding: .7rem .8rem;
  border: 1px solid #496681;
  border-radius: .7rem;
  background: #0b1a2d;
  color: #f7f9fc;
}
select { padding-right: 2.5rem; }
input::placeholder { color: #71879e; }
input:focus-visible, select:focus-visible, .button:focus-visible { outline: .18rem solid rgba(181, 210, 52, .75); outline-offset: .15rem; }
.field-help { margin-top: .4rem; font-size: .8rem; }

.access-row {
  margin-top: 1.4rem;
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid rgba(104, 139, 174, .22);
  border-bottom: 1px solid rgba(104, 139, 174, .22);
}
.access-row .label { margin-bottom: .25rem; color: #91a5bb; }
.access-value { margin: 0; font-weight: 700; }
.badge {
  padding: .38rem .65rem;
  border: 1px solid rgba(145, 165, 187, .32);
  border-radius: 999px;
  color: #b9c8d8;
  font-size: .76rem;
  font-weight: 800;
}
.badge.success { border-color: rgba(181, 210, 52, .38); background: rgba(181, 210, 52, .1); color: #cee76d; }
.badge.warning { border-color: rgba(239, 182, 90, .38); background: rgba(239, 182, 90, .08); color: #f2ca87; }

.account-actions, .button-row { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: .7rem; }
.button {
  min-height: 2.8rem;
  padding: .72rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: .7rem;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
}
.button.primary { background: #b5d234; color: #13200d; }
.button.primary:hover { background: #c6e34e; }
.button.secondary { border-color: #4a6884; background: #152b43; color: #f5f8fc; }
.button.quiet { border-color: rgba(104, 139, 174, .28); background: transparent; color: #b9c8d8; }
.button.danger { border-color: rgba(243, 123, 116, .5); background: rgba(243, 123, 116, .08); color: #ffaaa4; }
.button:disabled { opacity: .5; cursor: wait; }

.admin-nav { color: #b9c8d8; font-weight: 700; text-decoration: none; }
.admin-nav:hover { color: #fff; }
.crm-panel { padding: clamp(1rem, 4vw, 1.5rem); }
.invite-panel { margin-top: 1rem; padding: clamp(1rem, 4vw, 1.5rem); }
.section-heading h2 { margin-bottom: .5rem; }
.section-heading p:last-child { margin-bottom: 0; color: #b9c8d8; line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.email-field { grid-column: 1 / -1; }
.crm-summary { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.crm-summary h2 { margin-bottom: .5rem; }
.crm-summary p { margin-bottom: 0; color: #b9c8d8; line-height: 1.55; }
.crm-details { margin: 1.25rem 0 0; padding: 1rem 0 0; border-top: 1px solid rgba(104, 139, 174, .22); }
.crm-details div { display: grid; grid-template-columns: minmax(7rem, 1fr) 2fr; gap: 1rem; padding: .35rem 0; }
.crm-details dt { color: #91a5bb; }
.crm-details dd { margin: 0; overflow-wrap: anywhere; }
.confirmation { margin-top: 1rem; padding: 1rem; border-color: rgba(181, 210, 52, .35); }
.confirmation h3 { margin: 0 0 .45rem; font-size: 1rem; }
.confirmation p { margin-bottom: 0; color: #b9c8d8; line-height: 1.55; }
.confirmation.danger { border-color: rgba(243, 123, 116, .45); }
.inline-status { min-height: 1.4rem; margin: .8rem 0 0; color: #b9c8d8; }
.inline-status.success { color: #cee76d; }
.inline-status.error { color: #ffaaa4; }

footer { align-self: end; padding-top: 1rem; color: #71879e; font-size: .76rem; text-align: center; }

@media (max-width: 38rem) {
  .page-shell { padding-top: .5rem; }
  .site-header { min-height: 4rem; }
  .portal-card { margin: 1.5rem auto; border-radius: 1.1rem; }
  .crm-summary, .access-row { align-items: flex-start; flex-direction: column; }
  .button { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .email-field { grid-column: auto; }
  .crm-details div { grid-template-columns: 1fr; gap: .1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .loader { animation: none; }
}
