/* Customer portal (login and water samples). Builds on site.css. */

.login-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: clamp(32px, 6vw, 96px); align-items: start; }
@media (max-width: 860px) { .login-grid { grid-template-columns: 1fr; } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(24px, 3vw, 36px); }
.panel-title { margin: 0 0 24px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.panel .field-hint { margin: 18px 0 0; }
.panel .button { width: 100%; margin-top: 8px; }
.text-link { color: var(--text); }

.portal-head { display: flex; justify-content: space-between; align-items: end; gap: 32px; padding-bottom: 40px; flex-wrap: wrap; }
.portal-head h1 { margin-top: 16px; font-size: clamp(40px, 5vw, 64px); }
.portal-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.portal-actions label.button { cursor: pointer; }

.summary-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.summary-strip button { display: grid; gap: 8px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--text-soft); font: 500 14px "Manrope", sans-serif; text-align: left; cursor: pointer; transition: border-color 150ms; }
.summary-strip button:hover { border-color: var(--line-strong); }
.summary-strip button strong { color: var(--text); font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.summary-strip button.active { border-color: var(--accent); }
.summary-strip button[data-filter="limit_exceeded"] strong { color: var(--danger); }
.summary-strip button[data-filter="indicator_exceeded"] strong { color: var(--warn); }
.summary-strip button[data-filter="ok"] strong { color: var(--signal); }

.portal-section { margin-top: 64px; }
.portal-section > .meta { margin-bottom: 16px; display: flex; gap: 16px; align-items: center; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
.measure-row { display: grid; grid-template-columns: 2fr 1fr auto; gap: 12px; align-items: end; }
.measure-row .field { margin-bottom: 10px; }
.measure-row .link-button { margin-bottom: 24px; }

.sample-list { border-top: 1px solid var(--line); }
.sample { border-bottom: 1px solid var(--line); }
.sample-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; width: 100%; padding: 22px 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.sample-row:hover h3 { color: var(--accent); }
.sample-row h3 { margin: 0 0 6px; font-size: 19px; font-weight: 600; transition: color 150ms; }
.sample-row h3 small { color: var(--text-faint); font-size: 13px; font-weight: 500; margin-left: 8px; white-space: nowrap; }
.sample-meta { color: var(--text-soft); font-size: 13px; }
.sample-detail { padding: 0 0 26px; }
.detail-actions { margin-top: 16px; }

.badge { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.badge-ok { color: var(--signal); border-color: rgba(143, 175, 145, 0.45); }
.badge-indicator_exceeded { color: var(--warn); border-color: rgba(200, 148, 84, 0.5); }
.badge-limit_exceeded { color: var(--danger); border-color: rgba(224, 154, 134, 0.55); background: rgba(224, 154, 134, 0.1); }
.badge-not_evaluated { color: var(--text-faint); }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { padding: 10px 12px 10px 0; color: var(--text-faint); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-align: left; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.data-table td { padding: 11px 12px 11px 0; color: var(--text-soft); border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table td:first-child { color: var(--text); }
.table-scroll { overflow-x: auto; }
.empty { padding: 32px 0; color: var(--text-faint); font-size: 15px; }
details summary { cursor: pointer; }
code { font-size: 0.9em; padding: 1px 6px; border-radius: 0; background: var(--surface-2); }

@media (max-width: 760px) {
  .summary-strip { grid-template-columns: 1fr; }
  .summary-strip button strong { font-size: 32px; }
  .form-grid { grid-template-columns: 1fr; }
  .measure-row { grid-template-columns: 1fr; gap: 0; }
}

/* Portal: breadcrumb + compact stepper */
.portal-breadcrumb { margin: 10px 0 18px; font-size: 14px; color: var(--text-faint); }
.portal-breadcrumb ol { list-style: none; padding: 0; margin: 0; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.portal-breadcrumb li + li::before { content: "›"; margin: 0 8px; color: var(--text-faint); }

/* Trends grid (small inline SVG tiles for parameter trends) */
.trends-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.trend-tile { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.trend-meta { min-width: 0; }
.trend-meta .name { font-weight: 700; font-size: 14px; color: var(--text); display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.trend-meta .sub { color: var(--text-soft); font-size: 13px; margin-top:6px; }
.trend-svg { width: 120px; height: 56px; flex: 0 0 120px; }
.trend-svg svg { width: 100%; height: 100%; display:block; }
.trend-small { font-size: 12px; color: var(--text-faint); margin-left: auto; }

/* Show-all control */
.trends-actions { margin-top: 10px; display:flex; gap:12px; align-items:center; }
.trends-actions .link-button { padding: 6px 10px; border-radius: 0; border: 1px solid var(--line); background: transparent; color: var(--text-soft); }
.trends-actions .link-button:hover { color: var(--text); border-color: var(--line-strong); }

/* Order form: analyses checkbox grid and orders list (samples page) */
#order-analyses { min-height: 48px; }
.analyses-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin-top: 8px; }
.analyses-grid .analysis { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 0; background: var(--surface); cursor: pointer; color: var(--text); }
.analyses-grid .analysis input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--signal); }
.orders-list { display: grid; gap: 12px; }
.order-item { padding: 12px 0; border-bottom: 1px solid var(--line); display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.order-item .left { max-width: 70%; }
.order-id { font-weight:700; margin-bottom:6px; }
.order-meta { color: var(--text-soft); font-size: 13px; }
.order-price { font-weight:800; font-variant-numeric: tabular-nums; white-space:nowrap; }
.order-empty { color: var(--text-faint); padding: 12px 0; }

.portal-steps { display:flex; gap:12px; margin-top:12px; align-items:stretch; }
.portal-step { display:flex; gap:12px; align-items:center; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); min-width:180px; cursor:default; }
.portal-step .step-num { width:30px; height:30px; border-radius:999px; background:var(--field); color:var(--text); display:flex; align-items:center; justify-content:center; font-weight:700; }
.portal-step[aria-selected="true"] { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,0.06); }
.portal-step .step-text { display:flex; flex-direction:column; line-height:1; }
.portal-step .step-text strong { font-size:14px; }
.portal-step .step-sub { font-size:12px; color:var(--text-soft); margin-top:4px; }

/* Make language spans inline and not affect layout when hidden */
[data-lang] { display:inline; }
