/* ==========================================================================
   Customer portal — sign in, orders, quotations, tracking.
   Loaded after site.css on the portal pages only.
   ========================================================================== */

.page-hero--slim { padding-block: calc(var(--header-h) + clamp(28px, 5vw, 60px)) clamp(30px, 4vw, 52px); }
.page-hero--slim::before { background: radial-gradient(ellipse 70% 120% at 85% 0%, rgba(180, 135, 60, .18), rgba(6, 19, 40, 0) 60%), linear-gradient(180deg, rgba(6, 19, 40, .2), rgba(6, 19, 40, .6)); }
.page-hero--slim h1 { font-size: clamp(30px, 3.6vw, 48px); max-width: none; }
.page-hero--slim .lead { font-size: var(--fs-lead); }

.acct { display: block; background: var(--steel); padding-block: clamp(22px, 3.5vw, 44px) clamp(64px, 8vw, 110px); min-height: 52vh; }
.acct .wrap { max-width: 1040px; }
.acct--narrow .wrap { max-width: 560px; }

/* ---------------------------------------------------------------- portal nav */
.pnav {
  display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none;
  margin-block-end: clamp(20px, 2.6vw, 28px); padding: 5px; border-radius: 999px;
  background: #fff; box-shadow: 0 0 0 1px var(--line);
}
.pnav::-webkit-scrollbar { display: none; }
.pnav a, .pnav button {
  flex: none; padding: 10px 18px; border-radius: 999px; white-space: nowrap;
  font: 600 15px/1.2 var(--f-body); color: var(--muted); transition: background .2s, color .2s;
}
.pnav a:hover, .pnav button:hover { color: var(--navy); background: var(--steel); }
.pnav a[aria-current="page"] { background: var(--navy); color: #fff; }
.pnav .pnav__out { margin-inline-start: auto; color: var(--brass-deep); }

/* ---------------------------------------------------------------- cards */
.pcard { background: #fff; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); padding: clamp(20px, 3vw, 34px); }
.pcard + .pcard, .pstack > * + * { margin-top: clamp(16px, 2vw, 22px); }
.pcard__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-block-end: 18px; }
.pcard h2 { font: 600 clamp(21px, 2vw, 27px)/1.35 var(--f-display); color: var(--ink); }
.pcard h3 { font: 600 17px/1.5 var(--f-body); color: var(--ink); margin-block-end: 10px; }
.pcard .sub { color: var(--muted); font-size: 15px; line-height: 1.8; margin-top: 4px; }
.pgrid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(16px, 2vw, 22px); align-items: start; }
.pgrid > .pcard + .pcard { margin-top: 0; }

.welcome { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; background: var(--navy); color: var(--on-dark); box-shadow: none; position: relative; overflow: hidden; isolation: isolate; }
.welcome::after { content: ""; position: absolute; inset: -40% -10% auto auto; width: 340px; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(227, 196, 137, .22); z-index: -1; }
.welcome h2 { color: #fff; }
.welcome .sub { color: var(--on-dark-2); }
.welcome .btn-row { justify-content: flex-end; }

/* ---------------------------------------------------------------- forms */
.form { display: grid; gap: 18px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 8px; }
.field > span { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.field > span small { font-weight: 400; color: var(--muted); font-size: 13px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font: 500 16px/1.5 var(--f-body); transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 116px; resize: vertical; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%235B6981' stroke-width='1.8'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 16px center; padding-inline-end: 16px; padding-inline-start: 40px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 4px rgba(180, 135, 60, .16); }
.field input[dir="ltr"] { text-align: right; }
.field input[type="file"] { padding: 12px; min-height: 0; font-size: 14px; border-style: dashed; background: var(--steel); cursor: pointer; }
.field .hint { font-size: 13px; color: var(--muted); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }

.choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; border: 0; margin: 0; padding: 0; }
.choice legend { font-weight: 600; font-size: 14.5px; color: var(--ink); margin-block-end: 10px; padding: 0; }
.choice label {
  position: relative; display: grid; gap: 6px; padding: 16px; border-radius: 14px; cursor: pointer;
  box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .2s, background .2s;
}
.choice label:hover { box-shadow: inset 0 0 0 1.5px #B9C4D2; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice svg { width: 26px; height: 26px; color: var(--brass); }
.choice b { font-size: 16px; color: var(--ink); }
.choice small { font-size: 13px; color: var(--muted); line-height: 1.6; }
.choice label:has(input:checked) { box-shadow: inset 0 0 0 2px var(--navy); background: #F7F9FB; }
.choice label:has(input:focus-visible) { outline: 2px solid var(--brass); outline-offset: 3px; }

/* ---------------------------------------------------------------- auth */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; border-radius: 999px; background: var(--steel); margin-block-end: 22px; }
.tabs button { padding: 11px 12px; border-radius: 999px; font-weight: 600; font-size: 15px; color: var(--muted); }
.tabs button[aria-selected="true"] { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(11, 31, 58, .12); }
.otp-input { text-align: center !important; letter-spacing: .5em; font: 600 26px/1 var(--f-mono) !important; padding-inline-start: calc(16px + .5em) !important; }
.auth-note { font-size: 13.5px; color: var(--muted); text-align: center; line-height: 1.8; }
.linkish { color: var(--brass-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.linkish[disabled] { color: var(--muted); text-decoration: none; cursor: default; }
.auth-sent { text-align: center; }
.auth-sent b { direction: ltr; unicode-bidi: isolate; font-family: var(--f-mono); color: var(--ink); }
.auth-perks { display: grid; gap: 12px; margin-top: 22px; }
.auth-perks li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: var(--text); }
.auth-perks svg { width: 20px; height: 20px; color: var(--brass); flex: none; margin-top: 4px; }

/* ---------------------------------------------------------------- messages */
.msg { padding: 12px 16px; border-radius: 12px; font-size: 14.5px; line-height: 1.7; font-weight: 500; }
.msg:empty { display: none; }
.msg--err { background: #FDECEA; color: #8A1C12; }
.msg--ok { background: #E7F5EC; color: #1F6B3E; }
.msg--info { background: var(--steel); color: var(--text); }

.toast { position: fixed; inset-block-end: 24px; left: 50%; transform: translateX(-50%); z-index: 90; padding: 12px 20px; border-radius: 12px; font-weight: 600; font-size: 14.5px; color: #fff; background: #1F7A47; box-shadow: 0 14px 40px -12px rgba(6, 19, 40, .45); }
.toast--err { background: #B3261E; }

/* ---------------------------------------------------------------- lists */
.olist { display: grid; gap: 10px; }
.orow {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center;
  padding: 16px 18px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .2s, background .2s;
}
.orow:hover { box-shadow: inset 0 0 0 1.5px var(--brass); background: #FCFBF8; }
.orow__code { font: 600 15px/1.3 var(--f-mono); color: var(--ink); direction: ltr; unicode-bidi: isolate; letter-spacing: .02em; }
.orow__meta { grid-column: 1; font-size: 13.5px; color: var(--muted); }
.orow .badge { grid-row: 1 / span 2; grid-column: 2; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--gray { background: #EEF1F5; color: #5B6981; }
.badge--warn { background: #FFF4E0; color: #9A5B00; }
.badge--brand { background: #E8EEF8; color: #1A3560; }
.badge--ok { background: #E7F5EC; color: #1F6B3E; }

.empty { text-align: center; padding: clamp(28px, 5vw, 48px) 16px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.empty svg { width: 40px; height: 40px; color: #B9C4D2; }
.empty b { color: var(--ink); font-size: 17px; }
.skeleton { height: 64px; border-radius: 14px; background: linear-gradient(90deg, var(--steel) 25%, #F6F8FA 50%, var(--steel) 75%); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
.skeleton + .skeleton { margin-top: 10px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- detail */
.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.dl div { display: grid; gap: 2px; min-width: 0; }
.dl .wide { grid-column: 1 / -1; }
.dl dt { font-size: 13px; color: var(--muted); }
.dl dd { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }
.dl dd a { color: var(--brass-deep); text-decoration: underline; }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.files a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 500; color: var(--ink); max-width: 100%; }
.files a:hover { box-shadow: inset 0 0 0 1.5px var(--brass); }
.files svg { width: 18px; height: 18px; color: var(--brass); flex: none; }
.quote-ready { display: grid; gap: 14px; padding: 18px; border-radius: 14px; background: linear-gradient(135deg, #0B1F3A, #1A3560); color: var(--on-dark); }
.quote-ready p { color: var(--on-dark-2); font-size: 14.5px; }

.tl { list-style: none; display: grid; gap: 0; }
.tl li { position: relative; display: grid; gap: 2px; padding-inline-start: 28px; padding-block-end: 20px; }
.tl li::before { content: ""; position: absolute; inset-inline-start: 5px; top: 10px; bottom: -4px; width: 2px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl li::after { content: ""; position: absolute; inset-inline-start: 0; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px var(--brass); }
.tl li:last-child::after { background: var(--brass); box-shadow: 0 0 0 4px rgba(180, 135, 60, .2); }
.tl b { color: var(--ink); font-size: 15.5px; }
.tl .note { font-size: 14px; color: var(--text); }
.tl time { font-size: 13px; color: var(--muted); }

.back { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--brass-deep); margin-block-end: 16px; }
.back svg { width: 18px; height: 18px; transform: scaleX(-1); }

/* ---------------------------------------------------------------- tracking */
.track-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.track-form input { font-family: var(--f-mono); letter-spacing: .06em; text-transform: uppercase; }
.track-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block-end: 16px; margin-block-end: 18px; border-block-end: 1px solid var(--line); }
.track-head .orow__code { font-size: 20px; }
.track-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-block-end: 22px; }
.track-facts div { padding: 14px; border-radius: 12px; background: var(--steel); display: grid; gap: 2px; }
.track-facts dt { font-size: 12.5px; color: var(--muted); }
.track-facts dd { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- success */
.done { text-align: center; display: grid; gap: 16px; justify-items: center; }
.done__ic { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: #E7F5EC; color: #1F7A47; }
.done__ic svg { width: 32px; height: 32px; }
.done__code { width: 100%; padding: 18px; border-radius: 14px; border: 1.5px dashed #C9B48A; background: #FBF7EE; display: grid; gap: 6px; justify-items: center; }
.done__code span { font-size: 13px; font-weight: 600; color: var(--muted); }
.done__code b { font: 600 26px/1.2 var(--f-mono); color: var(--ink); letter-spacing: .04em; direction: ltr; }

@media (max-width: 860px) {
  .pgrid { grid-template-columns: 1fr; }
  .welcome { grid-template-columns: 1fr; }
  .welcome .btn-row { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .row2, .choice, .dl, .track-facts { grid-template-columns: 1fr; }
  .track-form { grid-template-columns: 1fr; }
  .pnav a, .pnav button { padding: 9px 14px; font-size: 14px; }
  .welcome .btn { flex: 1 1 100%; }
}
