:root {
  color-scheme: light;
  --navy: #071a3b;
  --navy-2: #0c2d59;
  --copper: #b84f20;
  --copper-dark: #913a18;
  --text: #13213a;
  --muted: #667085;
  --line: #d9dee7;
  --soft: #f6f8fb;
  --success: #18763b;
  --success-bg: #eff9f2;
  --pending: #b55a12;
  --pending-bg: #fff7ed;
  --danger: #ae2e24;
  --shadow: 0 12px 34px rgba(7, 26, 59, 0.07);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: #fff;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #fff; color: var(--text); }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; color: var(--navy); text-decoration: none; font-size: 21px; font-weight: 780; letter-spacing: -0.03em; }
.brand-mark { width: 34px; height: 30px; fill: none; stroke: var(--copper); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.primary-nav { height: 72px; display: flex; align-items: stretch; gap: 38px; }
.primary-nav a { position: relative; display: grid; place-items: center; color: #33415c; text-decoration: none; font-size: 14px; font-weight: 620; }
.primary-nav a.active::after { content: ""; position: absolute; inset: auto 0 -1px; height: 3px; background: var(--copper); }
.primary-nav a:hover { color: var(--navy); }
.account-nav { justify-self: end; display: flex; align-items: center; gap: 16px; color: #475467; font-size: 13px; }
.account-nav form { margin: 0; }
.text-button { padding: 8px 0; border: 0; background: none; color: var(--copper-dark); font-size: 13px; font-weight: 700; }
.text-link { color: var(--copper-dark); text-decoration: none; font-size: 13px; font-weight: 700; }
.header-button { min-height: 38px !important; padding-inline: 18px !important; font-size: 13px !important; }

.site-main { width: 100%; }
.portal-hero { min-height: 590px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(520px, 1fr); border-bottom: 1px solid var(--line); }
.hero-copy { padding: clamp(76px, 10vw, 148px) clamp(32px, 7vw, 112px); display: flex; flex-direction: column; justify-content: center; }
.hero-copy h1 { margin: 0; max-width: 660px; color: var(--navy); font-size: clamp(56px, 5.15vw, 76px); line-height: 0.98; letter-spacing: -0.058em; }
.hero-copy h1 span { white-space: nowrap; word-spacing: .24em; }
.hero-copy p { max-width: 610px; margin: 34px 0 0; color: #34415a; font-size: clamp(19px, 1.65vw, 25px); line-height: 1.5; }
.hero-actions { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 16px; }
.hero-visual { position: relative; overflow: hidden; min-height: 610px; margin: 0; background: #fff; }
.hero-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 52% center; }
.availability-message { max-width: 590px !important; margin-top: 20px !important; color: var(--copper-dark) !important; font-size: 16px !important; line-height: 1.45 !important; font-weight: 680; }

.button { min-height: 46px; padding: 0 22px; border: 1px solid transparent; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; gap: 18px; text-decoration: none; font-size: 14px; font-weight: 730; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary { background: var(--navy); color: #fff; }
.button.primary:hover { background: var(--navy-2); }
.button.outline { border-color: var(--copper); background: #fff; color: var(--copper-dark); }
.button.disabled { border-color: #b8c0ce; background: #f8fafc; color: #667085; cursor: default; }
.button.compact { min-height: 38px; padding: 0 16px; white-space: nowrap; font-size: 12px; }
.button.text-danger { padding-inline: 8px; border-color: transparent; background: transparent; color: var(--danger); }

.applications-section { padding: 74px clamp(24px, 5vw, 78px) 42px; background: #fff; }
.section-heading { margin-bottom: 30px; }
.section-heading h2, .admin-intro h1 { margin: 0; color: var(--navy); font-size: clamp(38px, 4vw, 58px); line-height: 1; letter-spacing: -0.045em; }
.section-heading p, .admin-intro p { margin: 16px 0 0; color: var(--muted); font-size: 18px; }
.app-catalog { border-top: 1px solid var(--line); }
.app-row { min-height: 116px; display: grid; grid-template-columns: 78px minmax(280px, 1fr) 190px 230px; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); }
.app-icon { width: 54px; height: 54px; display: grid; place-items: center; color: var(--copper); }
.app-icon svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.app-description h3 { margin: 0; color: var(--navy); font-size: 19px; }
.app-description p { max-width: 610px; margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.access-state { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 650; }
.state-dot { width: 12px; height: 12px; border: 2px solid currentColor; border-radius: 50%; }
.access-state.approved { color: var(--success); }
.access-state.pending { color: #2956a3; }
.access-state.none { color: var(--muted); }
.app-action form { margin: 0; }
.app-action .button { width: 100%; }
.governance-note { margin: 26px 0 0; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.governance-note svg { width: 22px; fill: none; stroke: var(--navy); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.public-app-row { grid-template-columns: 78px minmax(280px, 1fr) 190px; }
.public-app-action { justify-self: end; }
.text-arrow-link { display: inline-flex; align-items: center; gap: 18px; color: var(--copper-dark); text-decoration: none; font-size: 13px; font-weight: 730; }
.text-arrow-link:hover { color: var(--navy); }
.licensing-section { padding: 74px clamp(24px, 7vw, 112px); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 48px; border-top: 1px solid var(--line); background: var(--soft); }
.licensing-section h2 { margin: 0; color: var(--navy); font-size: clamp(38px, 4vw, 58px); line-height: 1; letter-spacing: -.045em; }
.licensing-section p { max-width: 720px; margin: 18px 0 0; color: var(--muted); font-size: 18px; line-height: 1.55; }
.licensing-actions { display: flex; flex-direction: column; gap: 12px; }

.admin-intro { padding: 54px clamp(24px, 4vw, 58px) 26px; }
.admin-intro h1 { font-size: clamp(38px, 4vw, 54px); }
.admin-create-grid { padding: 0 clamp(24px, 4vw, 58px) 36px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .92fr); gap: 28px; }
.create-user-panel, .issued-password, .admin-guidance { padding: 28px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.panel-heading h2, .issued-password h2, .admin-guidance h2, .admin-section h2 { margin: 0; color: var(--navy); font-size: 21px; }
.panel-heading p, .admin-section .section-title-row p { margin: 7px 0 22px; color: var(--muted); font-size: 13px; }
label, legend { color: #34415a; font-size: 12px; font-weight: 720; }
input[type=email], input[type=password] { width: 100%; min-height: 44px; margin-top: 7px; padding: 0 12px; border: 1px solid #c8d0dc; border-radius: 4px; background: #fff; color: var(--text); font-size: 14px; }
input:focus { outline: 3px solid rgba(184,79,32,.14); border-color: var(--copper); }
.app-checklist { margin: 22px 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.app-checklist legend { margin-bottom: 9px; grid-column: 1 / -1; }
.check-row { min-height: 38px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid #edf0f4; font-weight: 560; }
.check-row input { width: 16px; height: 16px; accent-color: var(--navy); }
.form-help { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.issued-password { display: grid; align-content: start; grid-template-columns: 42px 1fr; gap: 7px 16px; border-color: #90c6a2; background: var(--success-bg); }
.success-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--success); color: #fff; font-size: 23px; font-weight: 800; }
.issued-password p { margin: 7px 0 0; color: #41516a; font-size: 13px; }
.password-copy-row { grid-column: 1 / -1; margin-top: 16px; display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.password-copy-row code { min-height: 48px; padding: 0 14px; display: flex; align-items: center; border: 1px solid #b9c7be; border-radius: 4px; background: #fff; color: var(--navy); font-size: 18px; letter-spacing: .04em; }
.issued-detail { grid-column: 1 / -1; }
.admin-guidance { background: var(--soft); }
.admin-guidance ol { margin: 22px 0 0; padding-left: 22px; color: #41516a; line-height: 1.7; font-size: 14px; }
.notice { margin: 0 clamp(24px, 4vw, 58px) 22px; padding: 14px 16px; border-radius: 4px; font-size: 13px; }
.notice.error { border: 1px solid #e7a7a1; background: #fff4f3; color: var(--danger); }

.admin-section { margin: 0 clamp(24px, 4vw, 58px) 36px; }
.section-title-row { min-height: 62px; display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--copper); }
.section-title-row p { margin-bottom: 12px !important; }
.count { min-width: 28px; height: 28px; padding: 0 8px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); color: var(--navy); font-size: 12px; font-weight: 740; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-top: 0; }
table { width: 100%; border-collapse: collapse; color: #34415a; font-size: 12px; }
th, td { min-width: 138px; padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f8fafc; color: var(--navy); font-size: 11px; font-weight: 760; }
tr:last-child td { border-bottom: 0; }
.actions-cell { display: flex; align-items: center; gap: 8px; }
.actions-cell form, td form { margin: 0; }
.empty-state { padding: 28px; border: 1px solid var(--line); border-top: 0; color: var(--muted); font-size: 13px; }
.access-matrix table { min-width: 1320px; }
.sticky-user { position: sticky; left: 0; z-index: 2; min-width: 220px; background: #fff; box-shadow: 1px 0 0 var(--line); }
th.sticky-user { background: #f8fafc; z-index: 3; }
.role-label { margin-left: 7px; color: var(--copper-dark); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.permission { min-width: 92px; min-height: 34px; border-radius: 4px; background: #fff; font-size: 11px; font-weight: 690; }
.permission.approved { border: 1px solid #8bc39c; color: var(--success); background: var(--success-bg); }
.permission.pending { border: 1px solid #efb37c; color: var(--pending); background: var(--pending-bg); }
.permission.none { border: 1px solid #9bb3d6; color: #2956a3; }
.muted { color: var(--muted); }

.card { width: min(100% - 32px, 420px); margin: 72px auto; padding: 34px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: var(--shadow); }
.card h1 { margin: 0 0 24px; color: var(--navy); font-size: 28px; letter-spacing: -.035em; }
.card button { margin-top: 18px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 4px; background: var(--navy); color: #fff; font-weight: 720; }
.card .muted, .site-main > .muted { color: var(--muted); font-size: 13px; line-height: 1.55; }
.registration-card { width: min(100% - 32px, 680px); }
.registration-checklist { margin-bottom: 0; }
.error { color: var(--danger); }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; }
  .primary-nav { grid-row: 2; grid-column: 1 / -1; order: 3; width: 100%; height: 48px; justify-content: center; }
  .account-nav { grid-column: 2; }
  .portal-hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: 520px; }
  .hero-visual { min-height: 480px; }
  .app-row { grid-template-columns: 64px 1fr 190px; padding: 20px 0; }
  .app-action { grid-column: 2 / -1; }
  .public-app-row { grid-template-columns: 64px 1fr 150px; }
  .licensing-section { grid-template-columns: 1fr; }
  .licensing-actions { align-items: flex-start; }
  .admin-create-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .site-header { position: static; padding: 15px 18px; gap: 12px; }
  .brand { font-size: 18px; }
  .brand-mark { width: 29px; }
  .account-email { display: none; }
  .primary-nav { overflow-x: auto; justify-content: flex-start; gap: 28px; }
  .public-nav { display: none; }
  .public-actions { gap: 12px; }
  .hero-copy { min-height: auto; padding: 72px 24px; }
  .hero-copy h1 { font-size: 42px; line-height: 1.02; }
  .hero-copy h1 span { white-space: normal; }
  .hero-copy p { font-size: 18px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-visual { min-height: 360px; }
  .applications-section { padding-inline: 20px; }
  .app-row { grid-template-columns: 54px 1fr; gap: 14px; }
  .access-state { grid-column: 2; }
  .app-action { grid-column: 1 / -1; }
  .public-app-row { grid-template-columns: 54px 1fr; }
  .public-app-action { grid-column: 2; justify-self: start; }
  .governance-note { align-items: flex-start; }
  .licensing-section { padding: 62px 20px; }
  .licensing-actions { width: 100%; }
  .licensing-actions .button { width: 100%; }
  .admin-intro, .admin-create-grid { padding-inline: 18px; }
  .admin-section { margin-inline: 18px; }
  .app-checklist { grid-template-columns: 1fr; }
  .password-copy-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
