/* CAML client portal — plain CSS, no framework, no CDN.
   Fonts are the website's own, self-hosted, REGULAR ONLY: hierarchy comes from size and colour
   (Figma "Medium" styles are built as Regular per the typography note on page 4121:914). */

@font-face {
  font-family: "Golden Cockerel ITC Roman";
  src: url("/fonts/golden-cockerel-itc-roman.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Futura LT";
  src: url("/fonts/futura-lt.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand: #900000;
  --cream: #FEFAF3;
  --ink: #020101;
  --muted: #515151;
  --accent: #F15A24;
  --surface: #ffffff;
  --border: #E4DDD0;
  --error: #B3261E;
  --error-bg: #FCEDEC;
  --warning-text: #7A4A00;
  --warning-bg: #FEF6E7;
  --success-text: #1E6B3A;
  --success-bg: #EAF5EE;
  --skeleton: #EFEAE3;
  --serif: "Golden Cockerel ITC Roman", Georgia, "Times New Roman", serif;
  --sans: "Futura LT", "Futura", "Trebuchet MS", Arial, sans-serif;
  --gutter: 120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 24px;
}
h1, h2, p, ul, dl, dd, fieldset { margin: 0; padding: 0; }
ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.dot { margin: 0 8px; }

/* ---- Top bar ---- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar__inner { height: 88px; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo img { display: block; width: 174px; height: 48px; object-fit: contain; }
.link { color: var(--brand); font-size: 15px; line-height: 22px; letter-spacing: 0.3px; }
.link--button { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; letter-spacing: 0.3px; }
.account { display: flex; align-items: center; gap: 24px; }
.account__client { text-align: right; white-space: nowrap; }
.account__welcome { font-size: 15px; line-height: 24px; color: var(--ink); }
.account__no { font-size: 13px; line-height: 20px; color: var(--muted); }
.account__divider { width: 1px; height: 32px; background: var(--border); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 24px; border-radius: 0;
  font-family: var(--sans); font-size: 15px; line-height: 22px; letter-spacing: 0.3px;
  cursor: pointer; text-decoration: none; border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn--primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn--secondary { background: var(--cream); color: var(--brand); border-color: var(--brand); }
.btn--block { width: 100%; }

/* ---- Main ---- */
.main { flex: 1; display: flex; justify-content: center; padding: 96px 16px 120px; }
.main--wide { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 32px; padding: 56px var(--gutter) 80px; }

/* ---- Card (sign-in family) ---- */
.card {
  width: 520px; max-width: 100%;
  background: var(--surface); border: 1px solid var(--border);
  padding: 48px; display: flex; flex-direction: column; align-items: flex-start; gap: 24px;
}
.card > .btn--block, .card > .form, .card > .notice, .card > .divider, .card > .trust, .card > .help { width: 100%; }
.heading { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.rule { display: block; width: 32px; height: 3px; background: var(--brand); }
.eyebrow { font-size: 12px; line-height: 18px; letter-spacing: 0.96px; text-transform: uppercase; color: var(--brand); }
.title { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 50px; color: var(--ink); }
.lead { font-size: 17px; line-height: 26px; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 24px; }
.help { font-size: 15px; line-height: 24px; color: var(--muted); }
.help .link { margin-left: 6px; }
.divider { height: 1px; background: var(--border); }
.trust { display: flex; gap: 8px; align-items: flex-start; }
.trust img { flex: none; margin-top: 2px; }
.trust p, .caption { font-size: 13px; line-height: 20px; color: var(--muted); }

/* ---- Field ---- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { font-size: 14px; line-height: 20px; color: var(--ink); }
.field__input {
  height: 52px; padding: 0 16px; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 2px;
  font-family: var(--sans); font-size: 17px; line-height: 26px; color: var(--ink);
}
.field__input::placeholder { color: var(--muted); }
.field__input:focus { outline: none; border: 2px solid var(--brand); padding: 0 15px; }
.field__hint { font-size: 13px; line-height: 20px; color: var(--muted); }
.field--error .field__input { border: 2px solid var(--error); padding: 0 15px; }
.field--error .field__hint { color: var(--error); }

/* ---- Notice ---- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 2px; width: 100%; }
.notice img { flex: none; margin-top: 2px; }
.notice__text { display: flex; flex-direction: column; gap: 2px; font-size: 15px; line-height: 24px; color: var(--ink); }
.notice--warning { background: var(--warning-bg); }
.notice--warning .notice__title { color: var(--warning-text); }
.notice--error { background: var(--error-bg); }
.notice--error .notice__title { color: var(--error); }
.notice--success { background: var(--success-bg); }
.notice--success .notice__title { color: var(--success-text); }

/* ---- Password ---- */
.field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field__row .link { font-size: 14px; line-height: 20px; }
.rules { display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 20px; color: var(--muted); }
.rules li::before { content: "·"; margin-right: 8px; color: var(--brand); }
.rules li.rules__broken { color: var(--error); }

/* ---- Code boxes ---- */
.code { display: flex; gap: 12px; }
.code__box {
  width: 52px; height: 60px; border-radius: 2px; text-align: center; padding: 0;
  background: var(--surface); border: 1px solid var(--border);
  font-family: var(--sans); font-size: 28px; line-height: 36px; color: var(--ink);
}
span.code__box { display: inline-block; }
.code__box:focus { outline: none; border: 2px solid var(--brand); }
.code--error .code__box { background: var(--error-bg); border: 2px solid var(--error); color: var(--error); }
.resend { display: flex; flex-wrap: wrap; gap: 0 6px; align-items: center; font-size: 15px; line-height: 24px; color: var(--muted); }
.resend__form { display: inline; }
.resend__wait { color: var(--muted); }
.contact-lines { display: flex; flex-direction: column; gap: 4px; font-size: 15px; line-height: 24px; }

/* ---- Portfolio ---- */
.titleblock { display: flex; flex-direction: column; gap: 8px; }
.account-inline { display: none; }
.body-muted { font-size: 15px; line-height: 24px; color: var(--muted); }
.section-title { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 34px; color: var(--ink); }
.totals { display: flex; gap: 24px; }
.total {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 2px; padding: 24px 28px;
}
.total__label { font-size: 14px; line-height: 20px; color: var(--muted); }
.total__amount { font-family: var(--serif); font-size: 44px; line-height: 54px; color: var(--ink); overflow-wrap: anywhere; }
.main--wide > .caption { margin-top: -16px; }
.holdings { display: flex; flex-direction: column; gap: 16px; }
.holdings__heading { display: flex; align-items: baseline; gap: 12px; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); }
.table th, .table td { padding: 20px 16px; border-bottom: 1px solid var(--border); text-align: left; font-weight: 400; font-size: 15px; line-height: 22px; color: var(--ink); }
.table th:first-child, .table td:first-child { padding-left: 32px; }
.table th:last-child, .table td:last-child { padding-right: 32px; }
.table thead th { background: var(--cream); padding-top: 14px; padding-bottom: 14px; font-size: 12px; line-height: 18px; letter-spacing: 0.96px; text-transform: uppercase; color: var(--muted); }
.table .num { text-align: right; white-space: nowrap; }
.table td.num:nth-child(2), .table td.num:nth-child(3) { width: 170px; }
.table td.num:nth-child(4) { width: 210px; }
.table td.num:nth-child(5) { width: 130px; }
.table .muted { color: var(--muted); }
.fund { color: var(--ink); }
.ccy { display: inline-block; margin-left: 10px; padding: 1px 6px; background: var(--cream); border: 1px solid var(--border); font-size: 13px; line-height: 20px; color: var(--muted); }
.cards { display: none; }
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); padding: 64px 48px;
}
.empty .lead { max-width: 560px; }
.contact { background: var(--surface); border-left: 3px solid var(--brand); padding: 24px 32px; display: flex; flex-direction: column; gap: 8px; }
.contact__title { font-family: var(--sans); font-weight: 400; font-size: 18px; line-height: 26px; color: var(--ink); }
.contact__channels { display: flex; flex-direction: column; gap: 6px; }
.contact__channels li { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 24px; overflow-wrap: anywhere; }
.contact__channels img { flex: none; }

/* ---- Footer ---- */
.footer { padding: 0 var(--gutter); }
.footer__inner {
  border-top: 1px solid var(--border); padding: 24px 0;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  font-size: 13px; line-height: 20px; color: var(--muted);
}
.footer a { color: var(--muted); }

/* ---- Tablet ---- */
@media (max-width: 1100px) {
  :root { --gutter: 32px; }
}

/* ---- Mobile (Figma P01 4126:1063, P02 4127:1161, P03 4128:1345) ---- */
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .topbar__inner { height: 64px; }
  .logo img { width: 116px; height: 32px; }
  .topbar__back { font-size: 13px; }
  .account__client, .account__divider { display: none; }
  .account__signout .btn { height: auto; padding: 0; border: 0; background: none; }
  .main { padding: 24px 16px 48px; }
  .main--wide { padding: 24px 16px 48px; gap: 24px; }
  .card { padding: 32px 20px; gap: 20px; }
  .title { font-size: 32px; line-height: 40px; }
  .code { gap: 8px; }
  .code__box { width: 44px; height: 54px; font-size: 24px; }
  .account-inline { display: block; font-size: 15px; line-height: 24px; color: var(--ink); }
  .totals { flex-direction: column; gap: 16px; }
  .total { padding: 20px; }
  .total__amount { font-size: 34px; line-height: 42px; }
  .table { display: none; }
  .cards { display: flex; flex-direction: column; gap: 16px; }
  .holding-card { background: var(--surface); border: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
  .holding-card__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .holding-card__head .ccy { margin-left: 0; }
  .holding-card__value { font-family: var(--serif); font-size: 28px; line-height: 36px; }
  .holding-card dl { border-top: 1px solid var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
  .holding-card dl div { display: flex; justify-content: space-between; font-size: 13px; line-height: 20px; }
  .holding-card dt { color: var(--muted); }
  .holding-card dd { color: var(--ink); }
  .contact { padding: 20px; }
  .footer__inner { flex-direction: column; }
}

/* Multi-account grouping (one table per client account) */
.account-group { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; padding-top: 8px; }
.account-group__title { font-family: var(--sans); font-weight: 400; font-size: 18px; line-height: 26px; color: var(--ink); margin: 0; }
.topbar__back-short { display: none; }
@media (max-width: 720px) {
  .topbar__back-long { display: none; }
  .topbar__back-short { display: inline; font-size: 15px; }
}
