:root {
  --apex-primary: #3c74f3;
  --apex-primary-dark: #275bd4;
  --apex-primary-soft: #eef4ff;
  --apex-heading: #413e66;
  --apex-text: #444444;
  --apex-muted: #6c7190;
  --apex-line: #e7eaf3;
  --apex-surface: #ffffff;
  --apex-section: #f5f8fd;
  --apex-danger: #c83c4a;
  --apex-danger-dark: #a92f3b;
  --apex-success: #167c4c;
  --apex-warning: #92540a;
  --apex-shadow: 0 10px 30px rgba(65, 62, 102, 0.10);
  --apex-shadow-hover: 0 16px 42px rgba(65, 62, 102, 0.16);
  --apex-radius: 10px;
  --apex-radius-lg: 16px;
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  color: var(--apex-text);
  background: var(--apex-surface);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--apex-surface);
  color: var(--apex-text);
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--apex-primary);
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

a:hover {
  color: var(--apex-primary-dark);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  color: var(--apex-heading);
  font-family: Montserrat, "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  line-height: 1.22;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: 24px;
}

h2 {
  font-size: 1.45rem;
}

p {
  margin-top: 0;
}

::selection {
  color: #fff;
  background: var(--apex-primary);
}

.shell {
  width: min(1140px, calc(100% - 44px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid rgba(231, 234, 243, 0.85);
  box-shadow: 0 2px 18px rgba(65, 62, 102, 0.06);
  backdrop-filter: blur(12px);
}

.nav {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 1 510px;
  min-width: 0;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: min(510px, 100%);
  height: auto;
  max-height: 62px;
  object-fit: contain;
  object-position: left center;
}

.navlinks {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 25px;
  flex-wrap: wrap;
}

.navlinks a,
.linkbutton {
  position: relative;
  padding: 8px 0;
  border: 0;
  background: none;
  color: #413e66;
  font: 600 .82rem Montserrat, "Segoe UI", Arial, sans-serif;
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
}

.navlinks a::after,
.linkbutton::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--apex-primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .2s ease;
}

.navlinks a:hover,
.linkbutton:hover {
  color: var(--apex-primary);
}

.navlinks a:hover::after,
.linkbutton:hover::after {
  transform: scaleX(1);
}

.inline {
  display: inline;
  margin: 0;
}

.site-main {
  min-height: calc(100vh - 190px);
}

.main-shell {
  padding-top: 54px;
  padding-bottom: 74px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
  gap: 52px;
  align-items: center;
  min-height: 470px;
  margin: -54px calc(50% - 50vw) 64px;
  padding: 74px max(22px, calc((100vw - 1140px) / 2)) 70px;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 16%, rgba(193, 213, 255, .75) 0 7%, transparent 7.2%),
    radial-gradient(circle at 76% 66%, rgba(60, 116, 243, .10) 0 23%, transparent 23.2%),
    linear-gradient(180deg, #f5f8fd 0%, #f8faff 100%);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero::before {
  width: 240px;
  height: 240px;
  right: -120px;
  top: 32px;
  border: 38px solid rgba(60, 116, 243, .07);
}

.hero::after {
  width: 160px;
  height: 160px;
  left: -90px;
  bottom: -95px;
  background: rgba(60, 116, 243, .07);
}

.hero-copy,
.hero-visual {
  position: relative;
  z-index: 1;
}

.hero h1 {
  max-width: 690px;
  margin: 10px 0 20px;
  color: var(--apex-heading);
  font-size: clamp(2.65rem, 5.3vw, 4rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.hero h1 span {
  color: var(--apex-primary);
}

.hero .lead {
  max-width: 650px;
  margin-bottom: 28px;
  color: #626887;
  font-size: 1.06rem;
  line-height: 1.75;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--apex-primary);
  font: 700 .78rem Montserrat, "Segoe UI", Arial, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-visual {
  display: flex;
  min-height: 330px;
  align-items: center;
  justify-content: center;
}

.hero-device {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 1.25 / 1;
}

.hero-device::before {
  content: "";
  position: absolute;
  inset: 11% 3% 4% 10%;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 65px rgba(65, 62, 102, .15);
  transform: rotate(-2.5deg);
}

.device-topbar,
.device-card,
.device-pill,
.device-dot {
  position: absolute;
  z-index: 2;
}

.device-topbar {
  top: 18%;
  left: 18%;
  width: 60%;
  height: 10px;
  border-radius: 10px;
  background: #d9e4fb;
  box-shadow: 0 24px 0 #edf2fc, 0 48px 0 #edf2fc;
}

.device-card {
  right: 9%;
  bottom: 11%;
  width: 48%;
  height: 42%;
  border: 1px solid #e5eafb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(65, 62, 102, .12);
}

.device-card::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 20px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--apex-primary), #87a7fb);
  box-shadow: 68px 6px 0 -17px #c1d5ff;
}

.device-card::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 20px;
  left: 18px;
  height: 8px;
  border-radius: 8px;
  background: #e9effd;
  box-shadow: 0 -18px 0 #f2f5fc;
}

.device-pill {
  left: 4%;
  bottom: 20%;
  width: 38%;
  height: 58px;
  border-radius: 18px;
  background: var(--apex-primary);
  box-shadow: 0 18px 38px rgba(60, 116, 243, .28);
}

.device-pill::before,
.device-pill::after {
  content: "";
  position: absolute;
  top: 17px;
  height: 8px;
  border-radius: 8px;
  background: #fff;
}

.device-pill::before {
  left: 18px;
  width: 42%;
}

.device-pill::after {
  left: 18px;
  top: 34px;
  width: 28%;
  opacity: .65;
}

.device-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ee8e9e;
  top: 7%;
  right: 24%;
  box-shadow: 80px 63px 0 #fed253, -260px 205px 0 #8ccf4d;
}

.section-head {
  max-width: 700px;
  margin: 0 auto 38px;
  text-align: center;
}

.section-head h2 {
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 3.2vw, 2.35rem);
}

.section-head p {
  margin-bottom: 0;
  color: var(--apex-muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 26px;
}

.card,
.formcard,
.license-card,
.payment-box,
.empty,
table,
.stats a {
  border: 1px solid var(--apex-line);
  background: var(--apex-surface);
  box-shadow: var(--apex-shadow);
}

.card,
.formcard,
.license-card,
.payment-box,
.empty {
  border-radius: var(--apex-radius-lg);
}

.card {
  position: relative;
  padding: 30px;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--apex-primary), #83a5fb);
  transform: scaleX(.28);
  transform-origin: left;
  transition: transform .25s ease;
}

.card:hover {
  border-color: #dbe4fb;
  box-shadow: var(--apex-shadow-hover);
  transform: translateY(-5px);
}

.card:hover::before {
  transform: scaleX(1);
}

.card h2 {
  margin-bottom: 12px;
}

.card p {
  color: #626887;
}

.product-card {
  display: flex;
  min-height: 290px;
  flex-direction: column;
}

.product-card .actions {
  margin-top: auto;
}

.product-card-image {
  display: block;
  margin: -30px -30px 24px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #f2f5fb;
}

.product-card-image img,
.product-detail-image img,
.admin-product-image-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-image {
  width: min(100%, 760px);
  margin: 0 0 28px;
  overflow: hidden;
  border: 1px solid var(--apex-line);
  border-radius: var(--apex-radius-lg);
  aspect-ratio: 16 / 9;
  background: #f2f5fb;
  box-shadow: var(--apex-shadow);
}

.admin-product-image-preview {
  width: min(100%, 420px);
  margin: 4px 0 10px;
  overflow: hidden;
  border: 1px solid var(--apex-line);
  border-radius: 12px;
  aspect-ratio: 16 / 9;
  background: #f2f5fb;
}

.price {
  margin: 22px 0 24px;
  color: var(--apex-heading);
  font-family: Montserrat, "Segoe UI", Arial, sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px solid var(--apex-primary);
  border-radius: 999px;
  background: var(--apex-primary);
  color: #fff;
  font: 700 .82rem Montserrat, "Segoe UI", Arial, sans-serif;
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(60, 116, 243, .18);
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}

.button:hover {
  border-color: var(--apex-primary-dark);
  background: var(--apex-primary-dark);
  color: #fff;
  box-shadow: 0 11px 24px rgba(60, 116, 243, .25);
  transform: translateY(-1px);
}

.button.secondary {
  border-color: var(--apex-primary);
  background: transparent;
  color: var(--apex-primary);
  box-shadow: none;
}

.button.secondary:hover {
  background: var(--apex-primary);
  color: #fff;
}

.button.danger {
  border-color: var(--apex-danger);
  background: var(--apex-danger);
  box-shadow: 0 8px 18px rgba(200, 60, 74, .16);
}

.button.danger:hover {
  border-color: var(--apex-danger-dark);
  background: var(--apex-danger-dark);
}

.button.small {
  min-height: 34px;
  padding: 6px 13px;
  font-size: .74rem;
}

.button.wide {
  width: 100%;
  margin-top: 18px;
}

button:disabled,
.button:disabled {
  opacity: .58;
  cursor: not-allowed;
  transform: none;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.actions form {
  margin: 0;
}

.narrow {
  max-width: 760px;
  margin: 0 auto;
}

.narrow:not(.formcard) {
  padding: 36px 0 18px;
}

.formcard {
  max-width: 680px;
  margin: 24px auto 0;
  padding: 36px;
}

.wideform {
  max-width: 850px;
}

.formcard h1 {
  margin-bottom: 26px;
  text-align: center;
}

.formcard form {
  display: grid;
  gap: 10px;
}

label {
  margin-top: 4px;
  color: var(--apex-heading);
  font-family: Montserrat, "Segoe UI", Arial, sans-serif;
  font-size: .82rem;
  font-weight: 700;
}

.formcard input,
.formcard textarea,
.formcard select,
input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid #d8deeb;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--apex-text);
  font: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--apex-primary);
  box-shadow: 0 0 0 4px rgba(60, 116, 243, .10);
}

.check {
  display: flex !important;
  gap: 9px;
  align-items: center;
  margin: 6px 0;
  font-family: "Open Sans", Arial, sans-serif;
  font-weight: 600;
}

.check input {
  width: 17px;
  min-height: 17px;
  accent-color: var(--apex-primary);
}

.validation,
.field-validation-error {
  color: #b92f3d;
  font-size: .9rem;
}

.notice,
.warning {
  margin-bottom: 24px;
  padding: 14px 18px;
  border: 1px solid;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(65, 62, 102, .06);
}

.notice {
  border-color: #cce9dc;
  background: #f0fbf5;
  color: var(--apex-success);
}

.warning {
  border-color: #f3dcc2;
  background: #fff8ef;
  color: var(--apex-warning);
}

.empty {
  padding: 32px;
  border-style: dashed;
  color: var(--apex-muted);
  text-align: center;
  box-shadow: none;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--apex-radius);
  overflow: hidden;
}

th,
td {
  padding: 14px 15px;
  border-bottom: 1px solid #edf0f6;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--apex-section);
  color: var(--apex-heading);
  font: 700 .76rem Montserrat, "Segoe UI", Arial, sans-serif;
  letter-spacing: .025em;
  text-transform: uppercase;
}

tbody tr {
  transition: background-color .18s ease;
}

tbody tr:hover {
  background: #fafbfe;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.checkoutbar,
.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 26px 0 20px;
}

.pagehead h1 {
  margin-bottom: 0;
}

.checkoutbar {
  padding: 22px 24px;
  border: 1px solid #e2e7f3;
  border-radius: var(--apex-radius);
  background: var(--apex-section);
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr);
  gap: 30px;
  align-items: start;
}

.checkout-layout > section > p {
  max-width: 720px;
  color: var(--apex-muted);
}

.payment-box {
  padding: 24px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 13px 0;
}

.license-card {
  margin: 24px 0;
  padding: 28px;
}

.license-card h2 {
  margin-bottom: 8px;
}

.license-text {
  width: 100%;
  height: 280px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #dde4f2;
  border-radius: 10px;
  background: #f8faff;
  color: #37405f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.5;
  white-space: pre;
  overflow: auto;
}

.stack {
  display: grid;
  gap: 18px;
}

.rowcard {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.rowcard h2 {
  margin-bottom: 8px;
}

.rowcard p:last-child {
  margin-bottom: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.stats a {
  position: relative;
  padding: 26px;
  border-radius: var(--apex-radius-lg);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.stats a::after {
  content: "";
  position: absolute;
  width: 76px;
  height: 76px;
  right: -23px;
  bottom: -24px;
  border-radius: 50%;
  background: rgba(60, 116, 243, .08);
}

.stats a:hover {
  border-color: #d6e1fb;
  box-shadow: var(--apex-shadow-hover);
  transform: translateY(-3px);
}

.stats strong {
  display: block;
  margin-bottom: 6px;
  color: var(--apex-primary);
  font: 800 2rem Montserrat, "Segoe UI", Arial, sans-serif;
}

.stats span {
  color: var(--apex-muted);
  font-weight: 600;
}

.twocol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.lead {
  color: #5e6481;
  font-size: 1.14rem;
  line-height: 1.75;
}

hr {
  height: 1px;
  margin: 22px 0;
  border: 0;
  background: var(--apex-line);
}

code {
  padding: .12em .35em;
  border-radius: 5px;
  background: #f0f4fc;
  color: #3f4b73;
  word-break: break-all;
}

.site-footer {
  margin-top: 10px;
  border-top: 1px solid var(--apex-line);
  background: var(--apex-section);
}

.footer {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 24px;
  padding-bottom: 24px;
  color: #6b718b;
  font-size: .88rem;
}

.footer-brand {
  color: var(--apex-heading);
  font-family: Montserrat, "Segoe UI", Arial, sans-serif;
  font-weight: 700;
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-top: 68px;
    text-align: center;
  }

  .hero-copy {
    max-width: 760px;
    margin: 0 auto;
  }

  .hero .lead {
    margin-right: auto;
    margin-left: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    min-height: 250px;
  }

  .hero-device {
    width: min(410px, 92%);
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 30px, 1140px);
  }

  .site-header {
    position: static;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .navlinks {
    width: 100%;
    justify-content: flex-start;
    gap: 7px 20px;
  }

  .main-shell {
    padding-top: 36px;
    padding-bottom: 54px;
  }

  .hero {
    min-height: auto;
    margin-top: -36px;
    margin-bottom: 48px;
    padding-top: 54px;
    padding-bottom: 48px;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 12vw, 3.4rem);
  }

  .checkout-layout,
  .twocol {
    grid-template-columns: 1fr;
  }

  .rowcard,
  .checkoutbar,
  .pagehead,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .formcard {
    padding: 26px 22px;
  }

  table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 520px) {
  .grid,
  .stats {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 210px;
  }

  .card,
  .license-card {
    padding: 24px 20px;
  }

  .product-card-image {
    margin: -24px -20px 22px;
  }

  .actions,
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .actions .button,
  .actions form,
  .actions form .button,
  .hero-actions .button {
    width: 100%;
  }
}

/* Apex Software Solutions company footer and legal pages */
.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr .8fr;
  gap: 48px;
  padding-top: 44px;
  padding-bottom: 32px;
  color: #6b718b;
  font-size: .88rem;
}

.footer-grid p {
  margin: 10px 0 0;
}

.footer-company,
.footer-contact,
.footer-links {
  min-width: 0;
}

.footer-contact,
.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.footer-heading {
  margin-bottom: 4px;
  color: var(--apex-heading);
  font-family: Montserrat, "Segoe UI", Arial, sans-serif;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.footer-grid a {
  color: #5f6684;
  text-decoration: none;
}

.footer-grid a:hover {
  color: var(--apex-primary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
  padding-bottom: 24px;
  border-top: 1px solid var(--apex-line);
  color: #858ba3;
  font-size: .78rem;
}

.legal-page {
  max-width: 980px;
  margin: 0 auto;
}

.legal-hero {
  max-width: 700px;
  margin-bottom: 34px;
}

.legal-hero h1 {
  margin-bottom: 12px;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.legal-card {
  padding: 28px;
  border: 1px solid var(--apex-line);
  border-radius: var(--apex-radius-lg);
  background: var(--apex-surface);
  box-shadow: var(--apex-shadow);
}

.legal-card h2 {
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.legal-card p:last-child {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .footer-grid,
  .legal-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    gap: 26px;
    padding-top: 34px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 520px) {
  .brand {
    width: min(100%, 420px);
    flex-basis: auto;
  }

  .brand-logo {
    width: 100%;
    max-height: 54px;
  }
}

/* Persistent language selector */
.language-picker {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.language-picker select {
  min-width: 104px;
  padding: 7px 30px 7px 10px;
  border: 1px solid var(--apex-line);
  border-radius: 8px;
  background: var(--apex-surface);
  color: var(--apex-heading);
  font: 600 .78rem Montserrat, "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}

.language-picker select:focus {
  outline: 2px solid rgba(60, 116, 243, .25);
  outline-offset: 2px;
  border-color: var(--apex-primary);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* User profile */
.profile-page {
  max-width: 1080px;
  margin: 0 auto;
}

.profile-heading {
  max-width: 720px;
  margin-bottom: 30px;
}

.profile-heading h1 {
  margin-bottom: 12px;
}

.profile-heading > p:last-child,
.profile-panel-head p,
.form-intro,
.field-help,
.profile-field small {
  color: var(--apex-muted);
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
  gap: 26px;
  align-items: start;
}

.profile-sidebar {
  display: grid;
  gap: 26px;
}

.profile-panel {
  padding: 30px;
  border: 1px solid var(--apex-line);
  border-radius: var(--apex-radius-lg);
  background: var(--apex-surface);
  box-shadow: var(--apex-shadow);
}

.profile-panel.compact {
  padding: 26px;
}

.profile-panel-head {
  margin-bottom: 24px;
}

.profile-panel-head h2 {
  margin-bottom: 8px;
}

.profile-panel-head p {
  margin-bottom: 0;
}

.profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.profile-field {
  display: grid;
  align-content: start;
  gap: 6px;
}

.profile-field.full,
.profile-actions.full,
.profile-form > .validation {
  grid-column: 1 / -1;
}

.profile-field label {
  margin: 0;
}

.profile-field small,
.field-help {
  display: block;
  font-size: .82rem;
  line-height: 1.5;
}

.readonly-field {
  background: #f5f7fb !important;
  color: #69708b !important;
  cursor: not-allowed;
}

.profile-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 4px;
}

.profile-meta {
  display: grid;
  gap: 0;
  margin: 0;
}

.profile-meta div {
  padding: 13px 0;
  border-bottom: 1px solid var(--apex-line);
}

.profile-meta div:first-child {
  padding-top: 0;
}

.profile-meta div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.profile-meta dt {
  margin-bottom: 3px;
  color: var(--apex-muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.profile-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--apex-heading);
  font-weight: 600;
}

.security-panel .button.wide {
  margin-top: 4px;
}

.profile-password-card .eyebrow,
.profile-password-card .form-intro {
  text-align: center;
}

.profile-password-card .form-intro {
  margin: -12px auto 22px;
  max-width: 520px;
}

.profile-password-actions {
  margin-top: 12px;
}

@media (max-width: 820px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .profile-form {
    grid-template-columns: 1fr;
  }

  .profile-field.full,
  .profile-actions.full,
  .profile-form > .validation {
    grid-column: auto;
  }

  .profile-panel {
    padding: 24px 20px;
  }
}

/* Authenticator / TOTP */
.twofactor-summary {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--apex-line);
}

.twofactor-summary p {
  margin: 0;
  color: var(--apex-muted);
  font-size: .9rem;
  line-height: 1.55;
}

.twofactor-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.status-pill.success {
  color: #17633a;
  background: #e8f7ef;
  border: 1px solid #bce8cf;
}

.status-pill.neutral {
  color: #5d6475;
  background: #f3f5f8;
  border: 1px solid var(--apex-line);
}

.recovery-count {
  font-weight: 700;
}

.twofactor-page {
  max-width: 1060px;
  margin: 0 auto;
}

.twofactor-heading {
  margin-bottom: 26px;
}

.twofactor-setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr);
  gap: 26px;
  align-items: start;
}

.setup-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 22px;
}

.setup-step > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--apex-heading);
  color: white;
  font-weight: 800;
}

.setup-step h2 {
  margin: 0 0 5px;
  font-size: 1.05rem;
}

.setup-step p {
  margin: 0;
  color: var(--apex-muted);
  font-size: .9rem;
  line-height: 1.55;
}

.qr-box {
  display: flex;
  justify-content: center;
  margin: 8px 0 22px;
  padding: 20px;
  border: 1px solid var(--apex-line);
  border-radius: var(--apex-radius-lg);
  background: white;
}

.qr-box img {
  display: block;
  width: min(240px, 100%);
  height: auto;
}

.manual-key {
  display: grid;
  gap: 9px;
  padding: 16px;
  border-radius: var(--apex-radius);
  background: #f6f8fb;
  border: 1px solid var(--apex-line);
}

.manual-key > span {
  color: var(--apex-muted);
  font-size: .82rem;
  font-weight: 700;
}

.manual-key code {
  overflow-wrap: anywhere;
  color: var(--apex-heading);
  font-size: 1rem;
  line-height: 1.6;
}

.twofactor-form {
  display: grid;
  gap: 10px;
}

.twofactor-form .button {
  margin-top: 8px;
}

.twofactor-login-card {
  max-width: 520px;
}

.twofactor-login-card .eyebrow,
.twofactor-login-card .form-intro,
.recovery-codes-card .eyebrow {
  text-align: center;
}

.centered-link {
  display: block;
  margin-top: 10px;
  text-align: center;
}

.text-link {
  color: var(--apex-accent);
  font-weight: 700;
}

.recovery-codes-card {
  max-width: 720px;
}

.warning-box {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #f0c36d;
  border-radius: var(--apex-radius);
  background: #fff8e6;
  color: #6a4b0a;
  font-weight: 700;
  line-height: 1.5;
}

.recovery-code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 24px;
}

.recovery-code-grid code {
  display: block;
  padding: 11px 13px;
  border: 1px solid var(--apex-line);
  border-radius: var(--apex-radius);
  background: #f6f8fb;
  color: var(--apex-heading);
  text-align: center;
  font-size: .95rem;
  font-weight: 700;
}

@media (max-width: 820px) {
  .twofactor-setup-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .recovery-code-grid {
    grid-template-columns: 1fr;
  }

  .twofactor-status-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Admin session management */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--apex-line);
  border-radius: var(--apex-radius-lg);
  background: #fff;
}

.table-scroll table { margin: 0; min-width: 1180px; }
.session-table td { vertical-align: top; }
.session-table td > small,
.session-table td > strong + small { display: block; margin-top: 5px; }
.session-id { color: var(--apex-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; }
.session-client { max-width: 330px; }
.session-client span { display: block; font-weight: 700; }
.session-client small { display: block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--apex-muted); }
.empty-state { padding: 28px; text-align: center; color: var(--apex-muted); }

/* Login / registration CAPTCHA */
.captcha-challenge {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 2px 0 0;
}

.captcha-image-frame {
  width: 242px;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d8deeb;
  border-radius: 10px;
  background: #f4f7fb;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .65);
}

.captcha-image {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 8 / 3;
  user-select: none;
  -webkit-user-drag: none;
}

.captcha-refresh {
  min-width: 126px;
}

.captcha-input {
  max-width: 240px;
  letter-spacing: .32em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 1.08rem !important;
  font-weight: 700 !important;
  text-align: center;
}

@media (max-width: 520px) {
  .captcha-challenge {
    align-items: stretch;
    flex-direction: column;
  }

  .captcha-refresh,
  .captcha-input {
    width: 100%;
    max-width: 100%;
  }
}

.login-forgot-link {
  margin-top: 14px;
}

.recovery-regenerate-form {
  display: grid;
  gap: 10px;
}


/* Admin trial management */
.trial-search {
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid var(--apex-line);
  border-radius: var(--apex-radius);
  background: var(--apex-surface);
}
.trial-search label { display: block; margin: 0 0 8px; }
.trial-search-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.trial-search-row input { flex: 1 1 360px; }
.trial-search-row .button { flex: 0 0 auto; }
.trial-list-meta { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 12px; color: var(--apex-muted); }
.trial-table { min-width: 1220px !important; }
.trial-machine-key { max-width: 360px; }
.trial-machine-key code { display: block; max-width: 340px; overflow-wrap: anywhere; white-space: normal; }
.trial-user-agent { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trial-date-form { display: grid; grid-template-columns: minmax(210px, 1fr) auto; gap: 8px; align-items: center; }
.trial-date-form input { min-width: 210px; }
.trial-date-form + small { display: block; margin-top: 6px; color: var(--apex-muted); }
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin: 22px 0 0; }
.pager-page,
.pager-current { display: inline-flex; min-width: 34px; min-height: 34px; align-items: center; justify-content: center; padding: 4px 9px; border: 1px solid var(--apex-line); border-radius: 999px; text-decoration: none; }
.pager-page { background: #fff; color: var(--apex-primary); }
.pager-current { border-color: var(--apex-primary); background: var(--apex-primary); color: #fff; font-weight: 700; }

@media (max-width: 620px) {
  .trial-list-meta { align-items: flex-start; flex-direction: column; }
  .trial-search-row { align-items: stretch; flex-direction: column; }
  .trial-search-row .button { width: 100%; }
}

/* Minimal rich-text editor for admin product descriptions. */
.rich-text-shell {
  display: none;
  overflow: hidden;
  border: 1px solid #d8deeb;
  border-radius: 10px;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.rich-text-ready .rich-text-source {
  display: none;
}

.rich-text-ready .rich-text-shell {
  display: block;
}

.rich-text-shell:focus-within {
  border-color: var(--apex-primary);
  box-shadow: 0 0 0 4px rgba(60, 116, 243, .10);
}

.rich-text-toolbar {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px;
  border-bottom: 1px solid #e3e7f0;
  background: #f7f9fd;
}

.rich-text-tool {
  min-width: 34px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid #d7deeb;
  border-radius: 6px;
  background: #fff;
  color: var(--apex-heading);
  font: 700 .78rem Montserrat, "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}

.rich-text-tool:hover,
.rich-text-tool:focus-visible {
  border-color: var(--apex-primary);
  color: var(--apex-primary);
  outline: none;
}

.rich-text-tool-strong { font-weight: 800; }
.rich-text-tool-em { font-style: italic; }
.rich-text-tool-underline { text-decoration: underline; }
.rich-text-tool-wide { min-width: 54px; }

.rich-text-divider {
  width: 1px;
  height: 24px;
  margin: 0 2px;
  background: #d7deeb;
}

.rich-text-editor {
  min-height: 170px;
  max-height: 460px;
  overflow-y: auto;
  padding: 13px;
  outline: none;
  color: var(--apex-text);
  line-height: 1.65;
}

.rich-text-editor p,
.rich-product-description p,
.product-card-description p {
  margin: 0 0 .9em;
}

.rich-text-editor p:last-child,
.rich-product-description p:last-child,
.product-card-description p:last-child {
  margin-bottom: 0;
}

.rich-text-editor h2,
.rich-text-editor h3,
.rich-product-description h2,
.rich-product-description h3,
.product-card-description h2,
.product-card-description h3 {
  margin: 1em 0 .45em;
}

.rich-text-editor h2:first-child,
.rich-text-editor h3:first-child,
.rich-product-description h2:first-child,
.rich-product-description h3:first-child,
.product-card-description h2:first-child,
.product-card-description h3:first-child {
  margin-top: 0;
}

.rich-text-editor h2,
.rich-product-description h2 {
  font-size: 1.35rem;
}

.rich-text-editor h3,
.rich-product-description h3 {
  font-size: 1.1rem;
}

.rich-text-editor ul,
.rich-text-editor ol,
.rich-product-description ul,
.rich-product-description ol,
.product-card-description ul,
.product-card-description ol {
  margin: .6em 0 1em;
  padding-left: 1.5em;
}

.rich-product-description {
  margin: 0 0 10px;
}

.product-card-description {
  margin-bottom: 18px;
  color: #626887;
  line-height: 1.65;
}

.product-card-description h2,
.product-card-description h3 {
  color: var(--apex-heading);
  font-size: 1rem;
}
