:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #101f35;
  background: var(--navy);
  line-height: 1.5;
  --navy: #071326;
  --muted: #4c6079;
  --border: #d4deec;
  --blue: #1247b3;
  --blue-active: #0b358a;
  --cyan: #74e4ff;
  --shadow: 0 7px 22px #1027490a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  isolation: isolate;
  background: linear-gradient(155deg, #030b1aea, #0713264d 55%, #041223d9),
    url("/assets/fibra-optica.webp") center / cover fixed, var(--navy);
}
body::before {
  content: "";
  position: fixed;
  inset: 5rem 1rem 1rem;
  max-width: 76rem;
  margin-inline: auto;
  z-index: -1;
  pointer-events: none;
  background: url("/assets/logo-cevco.webp") center 35% / contain no-repeat;
  opacity: .38;
  mix-blend-mode: screen;
  mask-image: radial-gradient(ellipse 75% 75% at center, #000 50%, transparent 100%);
}
[hidden] { display: none !important; }
.masthead { background: #071326e8; color: white; border-bottom: 1px solid #243a55; }
.bar, main { width: min(100%, 76rem); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.4rem); }
.bar {
  min-height: 4.7rem; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; column-gap: .5rem;
}
.brand { grid-column: 2; grid-row: 1; display: block; border-radius: .5rem; }
.brand img { display: block; width: clamp(5rem, 18vw, 6.5rem); height: auto; border-radius: inherit; }
#exit { grid-column: 3; grid-row: 1; justify-self: end; max-width: 100%; }
.masthead .secondary { background: #12223a; color: #e6f4ff; border-color: #526884; }
.masthead .secondary:hover:not(:disabled) { background: #213b5b; }

main { padding-block: clamp(1rem, 3vw, 2rem) 4rem; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.45rem); line-height: 1; letter-spacing: -.062em; }
h2 { font-size: 1.24rem; line-height: 1.26; }
h3 { font-size: 1.09rem; line-height: 1.25; }
p, dt { color: var(--muted); }
h2 + p { margin-top: .45rem; }
:focus-visible { outline: 3px solid #2579e5; outline-offset: 3px; }
.hero :focus-visible, .masthead :focus-visible { outline-color: var(--cyan); }

.hero {
  display: grid; justify-items: center; align-content: center; gap: .9rem;
  min-height: 12rem; padding: clamp(1.15rem, 4vw, 2.4rem); text-align: center;
  border: 1px solid #203854; border-radius: 1.25rem; color: #fff;
  background: linear-gradient(105deg, #071326ad, #07132673, #071326ad);
  box-shadow: 0 13px 30px #12213f22;
}
.hero p { color: #cae2f8; max-width: 34rem; }
.hero h1 { margin: .55rem 0 .7rem; }
.hero .eyebrow { color: #8fe5fb; font-size: .85rem; letter-spacing: .075em; font-weight: 750; overflow-wrap: anywhere; }
.hero button { background: #8ae7ff; border-color: #b5f0ff; color: #092035; flex-shrink: 0; }
.hero button:hover:not(:disabled) { background: #c3f5ff; }

.auth-layout {
  width: min(100%, 30rem); margin: clamp(1.25rem, 5vw, 4rem) auto;
  border: 1px solid #d1dded; border-radius: 1.35rem; overflow: hidden;
  background: #fff; box-shadow: 0 22px 60px #193a6622;
}
.auth-form { padding: clamp(1.55rem, 5vw, 3.2rem); }
.auth-form h1 { font-size: clamp(2rem, 4vw, 3rem); margin: .85rem 0 .65rem; }
.auth-form p { margin-bottom: 1.35rem; }
.auth-form form h2 { margin-top: .4rem; }
.auth-form form p { margin: 0 0 .45rem; }
.security-label { display: inline-flex; gap: .55rem; align-items: center; color: #175286; font-size: .88rem; font-weight: 750; }
.lock-icon { display: inline-block; width: .85rem; height: .68rem; border: 2px solid currentColor; border-radius: .18rem; position: relative; margin-top: .22rem; }
.lock-icon::before { content: ""; width: .43rem; height: .37rem; border: 2px solid currentColor; border-bottom: 0; border-radius: .4rem .4rem 0 0; position: absolute; left: 50%; bottom: calc(100% + 1px); transform: translateX(-50%); }


.card { padding: clamp(1rem, 4vw, 1.6rem); margin: 1rem 0; background: #fff; border: 1px solid var(--border); border-radius: 1rem; box-shadow: var(--shadow); }
form { display: grid; gap: .7rem; }
.inline { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; margin: .95rem 0; }
.inline label { flex: 1; min-width: min(100%,16rem); }
label { font-size: .91rem; font-weight: 650; }
input, textarea, select { width: 100%; min-height: 2.85rem; padding: .66rem .8rem; border: 1px solid #a3b4cb; border-radius: .62rem; font: inherit; font-size: 1rem; color: inherit; background: #fff; }
label input, select { display: block; margin-top: .32rem; }
textarea { font-family: ui-monospace, monospace; resize: vertical; overflow-wrap: anywhere; }
button { min-height: 2.85rem; padding: .65rem 1rem; border: 1px solid transparent; border-radius: .62rem; background: var(--blue); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
button:hover:not(:disabled) { background: var(--blue-active); }
button:disabled { opacity: .6; cursor: wait; }
button.secondary { background: #fff; color: #163b75; border-color: #b9c9df; }
button.secondary:hover:not(:disabled) { background: #eaf3ff; border-color: #8faacb; }

.billing-expiration { margin-block: .45rem; font-weight: 700; color: #17457d; }

.heading, .row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.heading p { margin-top: .3rem; }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }
dl { display: grid; grid-template-columns: repeat(auto-fit,minmax(9rem,1fr)); gap: .75rem; margin: 1rem 0; }
dl div { padding: .65rem .8rem; border: 1px solid #dbe7fa; border-radius: .6rem; background: #eff5ff; }
dd { margin: .15rem 0 0; font: 650 1rem/1.35 ui-monospace, monospace; overflow-wrap: anywhere; }
dt { font-size: .88rem; }
.list:not(:empty) { margin-top: 1rem; }
.row { padding: .8rem 0; border-top: 1px solid var(--border); }
.row span { color: var(--muted); }
#notice, .client-notice { padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid #abdbc6; border-radius: .7rem; background: #dcf3e8; color: #185642; }
#notice.error, .client-notice.error { background: #fce8e7; color: #8b2c2b; border-color: #e9b7bc; }
button.danger { background: #fff; color: #932c2c; border-color: #ebbec0; }
button.danger:hover:not(:disabled) { background: #fff0f0; }
button.danger.solid { background: #993333; color: #fff; }
button.danger.solid:hover:not(:disabled) { background: #782626; }
.inline-error { color: #932c2c; }
dialog { max-width: min(calc(100% - 2rem),39rem); width: 100%; max-height: 90vh; border: 1px solid var(--border); border-radius: 1rem; padding: 1.4rem; color: inherit; box-shadow: 0 23px 90px #0312264d; }
dialog > p { margin-bottom: .85rem; }
dialog::backdrop { background: #05152dc4; }
#qr { display: block; margin: 1rem auto; max-width: 100%; object-fit: contain; }

@media (max-width: 480px) {
  body::before { inset: 8rem .75rem 1rem; background-position: center top; mask-image: none; }
  .masthead .secondary { padding-inline: .6rem; }
}

#admin, #client { --portal-teal: #096a71; --portal-line: #d9e5ee; }
.portal-nav {
  position: sticky; top: .35rem; z-index: 2; overflow-x: auto;
  display: flex; align-items: center; gap: .3rem; padding: .4rem;
  border: 1px solid #345871; border-radius: .72rem;
  color: #e6f4ff; background: #102a40;
}
.portal-nav > span { color: #a8dbea; font-size: .83rem; font-weight: 750; padding-inline: .6rem .8rem; }
.portal-nav > a {
  flex: 0 0 auto; padding: .5rem .75rem; border-radius: .42rem; text-decoration: none;
  color: #e6f4ff; font-size: .9rem; font-weight: 650;
}
.portal-nav > a:hover { background: #21445e; }
.portal-nav > a[aria-current="page"] { color: #06283a; background: #87ddeb; }
.portal-register { padding: 0; overflow: hidden; border-color: var(--portal-line); }
.portal-register-heading { padding: 1rem 1.2rem; border-bottom: 1px solid var(--portal-line); }
.portal-register-heading h1, .admin-form-page h1, #admin-customer-name, #site-name {
  font-size: clamp(1.45rem, 3.3vw, 2.15rem); line-height: 1.15; letter-spacing: -.035em;
  scroll-margin-top: 5rem;
}
#account-search-status { font-size: .86rem; }
.portal-register-tools { padding: .75rem 1.2rem .9rem; background: #f8fbff; }
.account-search { grid-template-columns: minmax(0, 1fr) auto; align-items: end; max-width: 46rem; }
.account-search button { background: var(--portal-teal); }
.account-search button:hover:not(:disabled) { background: #054d54; }
.account-filters { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .75rem; }
.account-filters button {
  min-height: 2.1rem; padding: .28rem .65rem; border-color: #bed4df; border-radius: .5rem;
  background: #fff; color: #245069; font-size: .83rem;
}
.account-filters button:hover:not(:disabled) { background: #e9f5f8; }
.account-filters button[aria-pressed="true"] { background: #d9f2f1; border-color: #5b9e9f; color: #074852; }
.account-filters span { margin-left: .22rem; font-variant-numeric: tabular-nums; }
.portal-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .94rem; }
.portal-table th, .portal-table td { padding: .67rem .85rem; overflow-wrap: anywhere; }
.portal-table :is(th, td):first-child { padding-inline-start: 1.2rem; }
.portal-table :is(th, td):last-child { text-align: right; padding-inline-end: 1.2rem; }
.portal-table thead { color: #37536d; background: #e9f1f8; font-size: .8rem; }
.portal-table tbody tr { border-top: 1px solid var(--portal-line); }
.portal-table tbody tr:hover, .portal-table tbody tr:focus-within { background: #f0f9fc; }
.portal-table td:last-child { font-variant-numeric: tabular-nums; }
.portal-table-link { color: #125878; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.portal-table-secondary { display: none; color: var(--muted); font-weight: 500; font-size: .78rem; margin-top: .2rem; }
.account-state {
  display: inline-block; padding: .23rem .49rem; border-radius: .38rem;
  font-size: .8rem; font-weight: 700; line-height: 1.25;
}
.account-state-active { background: #e0f4ed; color: #135d48; }
.account-state-blocked { background: #f9e8e6; color: #8b3329; }
.admin-form-page > p { margin-top: .55rem; }
.admin-customer-lead { border-top: 3px solid #2c9ba8; }
.admin-customer-heading { margin-top: .7rem; }
.portal-directory { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: .5rem; }
.directory-choice {
  display: grid; gap: .2rem; width: 100%; height: 100%; text-align: left; text-decoration: none;
  padding: .7rem .8rem; border: 1px solid var(--border); border-radius: .65rem;
  color: #123a80; background: #f4f7fd; overflow-wrap: anywhere;
}
.directory-meta { color: var(--muted); font-size: .86rem; font-weight: 500; }
.directory-choice:hover:not(:disabled), .directory-choice:is([aria-pressed="true"], [aria-current="page"]) { background: #e0edff; border-color: #5581b8; }
.directory-choice:is([aria-pressed="true"], [aria-current="page"]) { box-shadow: inset .24rem 0 #1247b3; }
.admin-back, .account-payment-link { color: #1247b3; font-weight: 700; }
.account-payment-link { align-self: center; padding-block: .45rem; }
#admin-customer-name { overflow-wrap: anywhere; }
#admin-customer-summary dd, #admin-equipment-details dd { font-family: inherit; }
#admin-customer-summary > p { margin-top: .6rem; }
.portal-workspace { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.portal-workspace > .card { margin: 0; }
.client-nav > a { text-align: center; }
.client-equipment-header { display: flex; align-items: end; gap: .7rem; justify-content: space-between; margin-block: .65rem; }
.client-equipment-header .admin-back { display: inline-block; padding: .35rem .6rem; border-radius: .45rem; background: #edf6ff; }
.client-mobile-picker { display: none; }
.client-equipment-directory { max-height: 64vh; overflow-y: auto; }
.client-equipment-directory .portal-directory { gap: .35rem; }
.client-equipment-directory .directory-choice { padding: .5rem .6rem; }
.client-equipment-content { min-width: 0; }
.client-equipment-content .equipment-thumb { width: clamp(3rem, 9vw, 4.25rem); }
.client-equipment-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.client-equipment-badges .billing-expiration { margin: 0; }
.client-equipment-nav { display: flex; gap: .25rem; padding: .25rem; margin-block: .75rem; background: #edf4fb; border: 1px solid var(--portal-line); border-radius: .65rem; }
.client-equipment-nav a { flex: 1; min-width: 0; padding: .5rem .25rem; border-radius: .42rem; text-align: center; text-decoration: none; color: #173e67; font-size: .9rem; font-weight: 650; }
.client-equipment-nav a:hover { background: #dbeaf8; }
.client-equipment-nav a[aria-current="page"] { color: white; background: var(--blue); }
.client-equipment-panel dl { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .45rem; margin-block: .6rem; }
.client-equipment-panel dl div { padding: .45rem .6rem; }
.client-equipment-panel .actions { margin-top: .55rem; gap: .45rem; }
.client-equipment-panel .actions button { padding-inline: .65rem; }
.client-equipment-panel .inline { margin-block: .65rem; }
.client-equipment-panel .row { padding-block: .45rem; }
.client-equipment-panel .list:not(:empty) { margin-top: .65rem; }
.client-inventory-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
#client .portal-register { margin-top: .75rem; }
#client .portal-register-heading { padding-block: .75rem; }
#client .portal-register-tools { padding-block: .65rem; }
#client .portal-table :is(th, td) { padding-block: .48rem; }
.equipment-heading, .equipment-identity { display: flex; align-items: center; gap: .65rem; }
.equipment-identity { font-weight: 650; }
.equipment-identity small { display: block; color: var(--muted); font-weight: 500; }
.equipment-identity > span:last-child { min-width: 0; }
.equipment-heading .equipment-thumb { width: clamp(4.1rem, 11vw, 6.5rem); }
.equipment-thumb {
  display: grid; place-items: center; width: 2.75rem; flex: 0 0 auto; aspect-ratio: 1;
  padding: .18rem; border: 1px solid #d3e1ef; border-radius: .55rem; background: #edf4fb;
}
.equipment-thumb img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; mix-blend-mode: multiply; }
.equipment-symbol {
  width: 75%; height: 33%; border-radius: .22rem; position: relative;
  background: #253f5c; box-shadow: inset 0 -.2rem #47627c;
}
.equipment-symbol::before {
  content: ""; position: absolute; inset: 24% 12% 31%;
  background: repeating-linear-gradient(90deg, #8ac8d1 0 13%, transparent 13% 23%);
}
.visual-status {
  display: inline-flex; align-items: baseline; gap: .28rem; width: fit-content;
  padding: .18rem .46rem; border-radius: .4rem; font-size: .8rem; line-height: 1.28; font-weight: 700;
}
.visual-status-icon { display: inline-block; margin-inline-end: .12rem; font-size: 1em; line-height: 1; }
.visual-status.enabled { background: #dff6eb; color: #126048; }
.visual-status.blocked { background: #fbe9e8; color: #942e26; }
.visual-status.pending { background: #fff2d8; color: #7a4b00; }
.visual-status.neutral { background: #ebf1f7; color: #3d556d; }
.equipment-states, .directory-content { display: grid; gap: .25rem; min-width: 0; justify-items: start; }
.equipment-choice { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: .6rem; }
#client-equipment-state { margin-block: .3rem; }
.client-inventory-tools {
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 16rem) auto;
  align-items: end; max-width: 52rem;
}
#client-inventory-count { font-size: .86rem; margin-top: .65rem; }
#company { margin-top: .35rem; }
#inventory-quota { font-size: .84rem; margin-block: 0 .25rem; }
.inventory-empty { color: var(--muted); }
.equipment-editor { border-top: 1px solid var(--border); margin-top: 1.25rem; padding-top: 1rem; }
.equipment-editor form { margin-top: .75rem; }
.admin-history summary { cursor: pointer; font-weight: 700; }
.admin-history .row { overflow-wrap: anywhere; }
#open-create:disabled { cursor: not-allowed; }
.payment-form {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  align-items: end;
  margin-top: 1rem;
}
.period-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .8rem; }
.period-dates input { width: 100%; }

.alternate-login { margin-block: .8rem .2rem; }
.alternate-login summary { color: #234c81; cursor: pointer; font-weight: 650; }
.alternate-login form { margin-top: .75rem; }
#admin-access > button { margin-top: .75rem; }
#credentials-new { display: grid; gap: .7rem; border: 0; padding: 0; margin: 0; min-width: 0; }
@media (max-width: 760px) {
  .portal-workspace { grid-template-columns: minmax(0, 1fr); }
  .client-equipment-directory { display: none; }
  .client-mobile-picker { display: block; width: min(57%, 17rem); color: #e6f4ff; font-size: .8rem; }
  .client-mobile-picker select { margin-top: .15rem; font-weight: 650; color: #101f35; }
  .client-inventory-tools { grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; }
  .client-inventory-tools > label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 38rem) {
  body { background-attachment: scroll; }
  .account-search, .client-inventory-tools { grid-template-columns: minmax(0, 1fr); }
  .client-inventory-tools { grid-template-columns: minmax(0, 1fr) auto; }
  .client-nav > a { flex: 1; padding-inline: .35rem; white-space: nowrap; }
  .client-equipment-header { align-items: center; }
  .client-equipment-content { padding: .75rem; }
  .client-equipment-panel dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-equipment-panel dl dd { font-size: .86rem; }
  #client .portal-register-heading, #client .portal-register-tools { padding-inline: .7rem; }
  .portal-table .visual-status { font-size: .73rem; padding-inline: .28rem; }
  .portal-table .equipment-thumb { width: 1.85rem; }
  .equipment-identity { gap: .35rem; }
  .portal-nav > span, .portal-table .compact-hide { display: none; }
  .portal-table-secondary:not([hidden]) { display: block; }
  .portal-table th, .portal-table td { padding-inline: .45rem; }
  .portal-table :is(th, td):first-child { padding-inline-start: .7rem; }
  .portal-table :is(th, td):last-child { padding-inline-end: .7rem; }
  dialog { padding: 1rem; max-height: 88dvh; }
}
