/* ============================================================
   CASHlib App — Design Foundation (authenticated area)
   Ported from the 2026 design handoff (styles.css + layout.css).
   Brand rule: ONLY two hues — blue #014360 + orange #FF9735.
   Everything else is a neutral. Shadows are neutral, except the
   orange CTA glow. Loaded only on login + dashboard + account
   pages, so it never collides with the marketing styles.
   ============================================================ */
:root {
  /* ---- Brand ---- */
  --blue:        #014360;
  --blue-700:    #013345;
  --blue-800:    #01242f;
  --blue-900:    #011a23;
  --blue-600:    #0a5b79;
  --orange:      #FF9735;
  --orange-600:  #ef861f;
  --orange-700:  #d9760f;

  /* ---- Neutrals (cool, derived from blue) ---- */
  --ink:         #082b3a;
  --ink-soft:    #516772;
  --ink-faint:   #8aa0ab;
  --line:        #e2ecf1;
  --line-soft:   #eef4f8;
  --bg:          #ffffff;
  --surface:     #f5fafd;
  --surface-2:   #ECF5FB;
  --cream:       #FBF7F1;

  /* ---- Type families ---- */
  --display: "Archivo Narrow", "Archivo", system-ui, sans-serif;
  --sans:    "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono:    "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ---- Type scale (fluid) ---- */
  --t-d1: clamp(44px, 6vw, 84px);
  --t-d2: clamp(34px, 4.4vw, 56px);
  --t-h2: clamp(28px, 3.4vw, 44px);
  --t-h3: clamp(20px, 1.6vw, 25px);
  --t-lead: clamp(17px, 1.4vw, 20px);
  --t-body: 16px;
  --t-sm: 14px;
  --t-xs: 12.5px;

  /* ---- Spacing scale (8pt) ---- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  /* ---- Radii ---- */
  --r-sm: 12px; --r: 18px; --r-lg: 26px; --r-xl: 36px; --r-pill: 999px;

  /* ---- Shadows (soft, neutral — never coloured) ---- */
  --sh-sm: 0 1px 2px rgba(1,36,47,.06), 0 4px 12px rgba(1,36,47,.05);
  --sh-md: 0 12px 30px -12px rgba(1,36,47,.22), 0 4px 12px rgba(1,36,47,.06);
  --sh-lg: 0 38px 70px -30px rgba(1,36,47,.38), 0 12px 30px -16px rgba(1,36,47,.16);
  --sh-cta: 0 10px 24px -10px rgba(255,151,53,.7);
  --sh-cta-hover: 0 16px 30px -10px rgba(255,151,53,.75);

  /* ---- Layout ---- */
  --maxw: 1200px;
  --header-h: 76px;
  --cl-logo-h: 40px;   /* single source of truth — CASHlib logo height across all app pages */

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-reveal: cubic-bezier(.2, .7, .2, 1);
}

/* This file is loaded ONLY on login/dashboard/account pages, so it
   never collides with the marketing chrome. Reset is page-wide. */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg);
  font-size: var(--t-body); line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.cl-app h1, .cl-app h2, .cl-app h3, .cl-app h4 {
  font-family: var(--display); margin: 0; line-height: 1.0;
  letter-spacing: -0.012em; font-weight: 700;
}
.cl-app p { margin: 0; }
.cl-app a { color: inherit; text-decoration: none; }
.cl-app button { font-family: inherit; cursor: pointer; }
.cl-app img { display: block; max-width: 100%; }

.cl-app .wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(18px, 4vw, 36px); }

/* ---- Buttons ---- */
.cl-app .btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: none; border-radius: var(--r-pill); font-weight: 700; font-family: var(--sans);
  cursor: pointer; white-space: nowrap; line-height: 1; letter-spacing: -0.01em;
  transition: transform .18s var(--ease-out), box-shadow .25s, background .2s, color .2s, border-color .2s; }
.cl-app .btn:active { transform: translateY(1px) scale(.99); }
.cl-app .btn-lg { font-size: 16.5px; padding: 17px 28px; }
.cl-app .btn-md { font-size: 15px; padding: 13px 22px; }
.cl-app .btn-sm { font-size: 14px; padding: 10px 18px; }

.cl-app .btn-primary { background: var(--orange); color: var(--blue-900); box-shadow: var(--sh-cta); }
.cl-app .btn-primary:hover { background: var(--orange-600); transform: translateY(-2px); box-shadow: var(--sh-cta-hover); }
.cl-app .btn-blue { background: var(--blue); color: #fff; box-shadow: var(--sh-md); }
.cl-app .btn-blue:hover { background: var(--blue-600); transform: translateY(-2px); box-shadow: var(--sh-lg); }
.cl-app .btn-ghost { background: transparent; color: var(--blue); border: 1.5px solid var(--line); }
.cl-app .btn-ghost:hover { border-color: var(--blue); background: var(--surface); transform: translateY(-2px); }
.cl-app .btn-ghost-light { background: rgba(255,255,255,.10); color: #fff; border: 1.5px solid rgba(255,255,255,.35); }
.cl-app .btn-ghost-light:hover { background: rgba(255,255,255,.18); transform: translateY(-2px); }
.cl-app .btn-white { background: #fff; color: var(--blue); box-shadow: var(--sh-md); }
.cl-app .btn-white:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); }

/* ---- Chips / eyebrows ---- */
.cl-app .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans);
  font-weight: 700; font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--orange-700); }
.cl-app .chip { display: inline-flex; align-items: center; gap: 9px; padding: 9px 16px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 600; background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.cl-app .chip-white { background: #fff; box-shadow: var(--sh-sm); }

.cl-app .dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); position: relative; flex: none; }
.cl-app .dot-live::after { content:""; position:absolute; inset:-4px; border-radius:50%; border:2px solid var(--orange); animation: cl-ping 1.9s ease-out infinite; }
@keyframes cl-ping { 0%{transform:scale(.6);opacity:.9} 80%,100%{transform:scale(1.9);opacity:0} }

/* ---- Layout helpers ---- */
.cl-app .row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cl-app .split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px,4vw,56px); align-items: center; }

/* ---- Modern utilities ---- */
.cl-app .hair { border: 1px solid var(--line); }
.cl-app .glass { background: rgba(255,255,255,.62); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border: 1px solid rgba(255,255,255,.7); }
.cl-app .mono-label { font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--orange-700); }
.cl-app .dot-grid { background-image: radial-gradient(rgba(1,67,96,.10) 1.1px, transparent 1.1px); background-size: 26px 26px; }

/* ---- Alerts (flash messages) ---- */
.cl-app .cl-alert { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-radius: var(--r);
  font-size: 14.5px; font-weight: 600; margin-bottom: 14px; border: 1px solid transparent; }
.cl-app .cl-alert-success { background: #f1faf4; color: #1f7a4d; border-color: #bfe3cf; }
.cl-app .cl-alert-error,
.cl-app .cl-alert-danger { background: #fff4ec; color: #c2410c; border-color: #f3d6c4; }
.cl-app .cl-alert-info { background: var(--surface-2); color: var(--blue); border-color: #cfe1ec; }

/* ---- Reveal-on-load (base visible; animates only under html.animate) ---- */
@keyframes cl-revIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.cl-app [data-reveal] { opacity: 1; transform: none; }
html.animate .cl-app [data-reveal] { animation: cl-revIn .7s var(--ease-reveal) both; }
@media (prefers-reduced-motion: reduce) {
  html.animate .cl-app [data-reveal]{ animation: none; }
  .cl-app .dot-live::after{ animation: none; }
}
@media print { .cl-app [data-reveal]{ animation: none !important; opacity: 1 !important; transform: none !important; } }

.cl-app ::selection { background: var(--orange); color: var(--blue-900); }
.cl-app :focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

/* Gentle float (gated so paused/print contexts stay still) */
@keyframes cl-floaty { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-12px); } }
html.animate .cl-app .float-soft { animation: cl-floaty 6s ease-in-out infinite; }
@keyframes cl-slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Container-query layout system — the whole surface is a
   container (.app-shell); layout responds to container width.
   ============================================================ */
.cl-app.app-shell, .cl-app .app-shell { container-type: inline-size; container-name: app; }

.cl-app .hdr-nav { display: flex; }
.cl-app .hdr-actions-full { display: flex; align-items: center; gap: 14px; }
.cl-app .hdr-burger { display: none; }
.cl-app .only-mobile { display: none !important; }

@container app (max-width: 920px) {
  .cl-app .hdr-nav { display: none; }
  .cl-app .hdr-actions-full { display: none; }
  .cl-app .hdr-burger { display: inline-flex; }
}
@container app (max-width: 680px) {
  .cl-app .split { grid-template-columns: 1fr; gap: 32px; }
  .cl-app .only-mobile { display: flex !important; }
  .cl-app .hide-mobile { display: none !important; }
  .cl-app .wrap { padding-inline: 18px; }
}

/* ---- App footer (authenticated area) ---- */
.cl-app .cl-footer { background: linear-gradient(150deg, var(--blue-700), var(--blue-900)); color: rgba(255,255,255,.85); }
.cl-app .cl-footer__inner { max-width: var(--maxw); margin: 0 auto; padding: clamp(28px,4vw,44px) clamp(18px,4vw,36px); }
.cl-app .cl-footer__top { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cl-app .cl-footer__logo img { height: var(--cl-logo-h); width: auto; }
.cl-app .cl-footer__links { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.cl-app .cl-footer__links a { color: rgba(255,255,255,.82); font-size: 14px; font-weight: 600; }
.cl-app .cl-footer__links a:hover { color: #fff; }
.cl-app .cl-footer__copy { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12.5px; color: rgba(255,255,255,.55); line-height: 1.5; }
@media (max-width: 680px) { .cl-app .cl-footer__top { flex-direction: column; align-items: flex-start; } }

/* ---- Form field primitives (shared: login, settings, KYC, refund) ---- */
.cl-app .field { display: flex; flex-direction: column; gap: 7px; }
.cl-app .flabel { font-size: 13px; font-weight: 700; color: var(--ink); }
.cl-app .input { width: 100%; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg);
  font-family: var(--sans); font-size: 15px; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.cl-app textarea.input { resize: vertical; min-height: 92px; line-height: 1.5; }
.cl-app select.input { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23516772' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 42px; }
.cl-app .input::placeholder { color: var(--ink-faint); }
.cl-app .input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(1,67,96,.08); }
.cl-app .input-wrap { position: relative; display: flex; align-items: center; }
.cl-app .input-wrap .input { padding-right: 46px; }
.cl-app .input-icon { position: absolute; right: 14px; color: var(--ink-faint); display: grid; place-items: center; cursor: pointer; background: none; border: none; }
.cl-app .input-icon.on { color: var(--blue); }

/* ---- Language dropdown (shared: header + auth) ---- */
.cl-app .lang-wrap { position: relative; }
.cl-app .lang-btn { display: inline-flex; align-items: center; gap: 5px; border: none; background: transparent;
  font-size: 14px; font-weight: 700; color: var(--ink); padding: 8px 6px; cursor: pointer; }
.cl-app .lang-menu { position: absolute; top: calc(100% + 6px); right: 0; background: #fff; border-radius: 12px;
  box-shadow: var(--sh-lg); padding: 6px; display: none; gap: 2px; min-width: 150px; z-index: 60; }
.cl-app .lang-menu.open { display: grid; }
.cl-app .lang-menu a { text-align: left; border-radius: 8px; padding: 9px 12px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.cl-app .lang-menu a:hover { background: var(--surface-2); }

/* Shared round icon button + avatar (used by header, dock, drawers) */
.cl-app .icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: none; cursor: pointer; flex: none; transition: transform .2s var(--ease-out), box-shadow .25s, background .2s; }
.cl-app .icon-btn:hover { transform: translateY(-2px) scale(1.04); }
.cl-app .icon-btn:active { transform: scale(.96); }
.cl-app .avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-family: var(--display); font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(140deg, var(--blue-600), var(--blue-900)); }
