/* ==========================================================================
   URNO Capital — XTB-inspired frontend & dashboard styles
   Brand: navy #0B3A66 · accent #1FA2FF · light default + [data-theme="dark"]
   Fonts: Instrument Sans (headings) · DM Sans (body)
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --navy: #0B3A66;
  --navy-deep: #072844;
  --navy-soft: #0f4a7a;
  --accent: #1FA2FF;
  --accent-hover: #0d8ee6;
  --accent-soft: rgba(31, 162, 255, 0.12);
  --accent-mid: rgba(31, 162, 255, 0.22);

  --bg: #f5f8fc;
  --bg-elevated: #ffffff;
  --bg-muted: #eef3f9;
  --bg-hero: linear-gradient(135deg, #0B3A66 0%, #0a4d82 48%, #0c6bab 100%);
  --surface: #ffffff;
  --surface-2: #f0f5fb;
  --border: rgba(11, 58, 102, 0.12);
  --border-strong: rgba(11, 58, 102, 0.22);
  --text: #142433;
  --text-secondary: #4a5d73;
  --text-muted: #6b7f96;
  --text-inverse: #ffffff;
  --heading: #0B3A66;

  --success: #0f9f6e;
  --success-bg: rgba(15, 159, 110, 0.1);
  --danger: #d64545;
  --danger-bg: rgba(214, 69, 69, 0.1);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.12);
  --info: #1FA2FF;
  --info-bg: rgba(31, 162, 255, 0.1);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(11, 58, 102, 0.06);
  --shadow: 0 8px 24px rgba(11, 58, 102, 0.08);
  --shadow-lg: 0 18px 48px rgba(11, 58, 102, 0.14);
  --shadow-lift: 0 14px 36px rgba(11, 58, 102, 0.16);

  --font-heading: "Instrument Sans", "Segoe UI", sans-serif;
  --font-body: "DM Sans", "Segoe UI", sans-serif;
  --container: 1180px;
  --header-h: 84px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.22s var(--ease);
}

[data-theme="dark"] {
  --bg: #0a1522;
  --bg-elevated: #101e2e;
  --bg-muted: #152536;
  --bg-hero: linear-gradient(135deg, #061526 0%, #0B3A66 55%, #0d5a8f 100%);
  --surface: #121f2f;
  --surface-2: #182738;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8eef6;
  --text-secondary: #a8b8cb;
  --text-muted: #7e92a8;
  --text-inverse: #ffffff;
  --heading: #f2f7fc;
  --accent-soft: rgba(31, 162, 255, 0.18);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 22px 50px rgba(0, 0, 0, 0.5);
  --shadow-lift: 0 16px 40px rgba(0, 0, 0, 0.55);
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(31, 162, 255, 0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(11, 58, 102, 0.06), transparent 50%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

[data-theme="dark"] body {
  background:
    radial-gradient(1000px 500px at 0% 0%, rgba(31, 162, 255, 0.1), transparent 50%),
    radial-gradient(800px 400px at 100% 10%, rgba(11, 58, 102, 0.35), transparent 55%),
    var(--bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 650;
  line-height: 1.2;
  color: var(--heading);
  margin: 0 0 0.6em;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1em; padding-left: 1.25em; }

code, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-muted);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* ---------- Layout helpers ---------- */
.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.container-narrow {
  width: min(100% - 2rem, 720px);
  margin-inline: auto;
}

.section {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.section-tight {
  padding: clamp(2rem, 4vw, 3rem) 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 2rem;
}

.section-head p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.gap-sm { gap: 0.5rem; }
.gap-lg { gap: 1.5rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------- Motion ---------- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes underline-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes soft-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31, 162, 255, 0.35); }
  50% { box-shadow: 0 0 0 10px rgba(31, 162, 255, 0); }
}

.fade-up,
[data-animate="fade-up"] {
  animation: fade-up 0.7s var(--ease) both;
}

.fade-up-delay-1 { animation-delay: 0.1s; }
.fade-up-delay-2 { animation-delay: 0.2s; }
.fade-up-delay-3 { animation-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(31, 162, 255, 0.28);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--navy);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--navy-soft);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--border-strong);
}

[data-theme="dark"] .btn-outline {
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.9rem 1.6rem;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ---------- Site header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--heading);
  text-decoration: none;
  min-width: 0;
}

.brand:hover {
  color: var(--heading);
}

.brand__logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand__text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand__text-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.brand__text-input {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--heading);
  background: transparent;
  border: 1px dashed transparent;
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  max-width: 180px;
  min-width: 80px;
}

.brand__text-input:hover,
.brand__text-input:focus {
  border-color: var(--accent);
  outline: none;
  background: var(--accent-soft);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.site-nav a {
  position: relative;
  color: var(--text-secondary);
  font-weight: 550;
  font-size: 0.95rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.3rem;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
  border-radius: 2px;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--navy);
  background: transparent;
}

[data-theme="dark"] .site-nav a:hover,
[data-theme="dark"] .site-nav a.is-active {
  color: var(--text);
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
  animation: underline-grow 0.28s var(--ease);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--heading);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- Hero (full-bleed) ---------- */
.hero {
  position: relative;
  min-height: clamp(420px, 72vh, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--text-inverse);
  background: var(--bg-hero);
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__media img,
.hero__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(7, 40, 68, 0.35) 0%, rgba(7, 40, 68, 0.55) 40%, rgba(7, 40, 68, 0.88) 100%),
    linear-gradient(90deg, rgba(7, 40, 68, 0.72) 0%, rgba(7, 40, 68, 0.25) 70%, transparent 100%);
}

.hero__content {
  position: relative;
  z-index: 2;
  width: min(100% - 2rem, var(--container));
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem);
  max-width: 640px;
  margin-left: max(1rem, calc((100% - var(--container)) / 2));
}

.hero__content h1 {
  color: #fff;
  margin-bottom: 0.85rem;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}

.hero__content p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.1rem;
  max-width: 36ch;
  margin-bottom: 1.5rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero .btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.hero .btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
  color: #fff;
}

.hero--compact {
  min-height: 280px;
  align-items: center;
}

.hero--compact .hero__content {
  padding-block: 3rem;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.hero--compact .hero__content p {
  margin-inline: auto;
}

/* ---------- Interest rate matrix (XTB-style data density) ---------- */
.rate-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.rate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 118px;
}

.rate-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--accent-mid);
}

.rate-card__pair {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.rate-card__symbol {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--heading);
  letter-spacing: -0.01em;
}

.rate-card__badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.rate-card__label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.rate-card__rate {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

[data-theme="dark"] .rate-card__rate {
  color: var(--accent);
}

.rate-card__meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}

.rate-card__change--up { color: var(--success); }
.rate-card__change--down { color: var(--danger); }

.rate-matrix-section {
  margin-top: -3rem;
  position: relative;
  z-index: 3;
}

.rate-matrix-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.rate-matrix-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.rate-matrix-panel__head h2 {
  font-size: 1.15rem;
  margin: 0;
}

/* ---------- Feature sections ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.feature {
  padding: 1.5rem 0;
}

.feature__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.feature h3 {
  margin-bottom: 0.5rem;
}

.feature p {
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.feature-band {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.split__media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-muted);
  min-height: 280px;
  box-shadow: var(--shadow);
}

.split__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 280px;
}

/* ---------- Plan cards ---------- */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
  position: relative;
  overflow: hidden;
}

.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: var(--accent-mid);
}

.plan-card--featured {
  border-color: var(--accent);
  box-shadow: var(--shadow), 0 0 0 1px var(--accent-soft);
}

.plan-card--featured::before {
  content: "Popular";
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
}

.plan-card__name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--heading);
  margin: 0;
}

.plan-card__rate {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.04em;
  line-height: 1;
}

[data-theme="dark"] .plan-card__rate {
  color: var(--accent);
}

.plan-card__rate span {
  font-size: 0.95rem;
  font-weight: 550;
  color: var(--text-muted);
  letter-spacing: 0;
}

.plan-card__desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  flex: 1;
}

.plan-card__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-block: 1px solid var(--border);
  font-size: 0.85rem;
}

.plan-card__meta dt {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.15rem;
}

.plan-card__meta dd {
  margin: 0;
  font-weight: 650;
  color: var(--heading);
}

.plan-card .btn {
  margin-top: auto;
}

/* ---------- Blog cards ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform var(--transition),
    box-shadow var(--transition);
  text-decoration: none;
  color: inherit;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  color: inherit;
}

.blog-card__media {
  aspect-ratio: 16 / 10;
  background: var(--bg-muted);
  overflow: hidden;
}

.blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.blog-card:hover .blog-card__media img {
  transform: scale(1.04);
}

.blog-card__body {
  padding: 1.15rem 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.blog-card__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.blog-card__title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 650;
  color: var(--heading);
  margin: 0;
}

.blog-card__excerpt {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

table.data-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-muted);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: var(--accent-soft);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .num,
.data-table td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-family: var(--font-heading);
  font-weight: 600;
}

/* ---------- Forms ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label,
.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--heading);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="search"],
input[type="file"],
select,
textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-control.is-invalid,
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: var(--danger);
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.form-check input {
  width: auto;
  margin-top: 0.2rem;
}

.auth-card {
  width: min(100% - 2rem, 440px);
  margin: 3rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
}

.auth-card .lead {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* ---------- Badges & alerts ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  background: var(--bg-muted);
  color: var(--text-secondary);
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.alert-success {
  background: var(--success-bg);
  border-color: rgba(15, 159, 110, 0.25);
  color: var(--success);
}

.alert-error,
.alert-danger {
  background: var(--danger-bg);
  border-color: rgba(214, 69, 69, 0.25);
  color: var(--danger);
}

.alert-warning {
  background: var(--warning-bg);
  border-color: rgba(217, 119, 6, 0.25);
  color: var(--warning);
}

.alert-info {
  background: var(--info-bg);
  border-color: rgba(31, 162, 255, 0.25);
  color: var(--navy);
}

[data-theme="dark"] .alert-info {
  color: var(--accent);
}

.flash-stack {
  width: min(100% - 2rem, var(--container));
  margin: 1rem auto 0;
}

/* ---------- Page chrome ---------- */
.page-main {
  min-height: calc(100vh - var(--header-h) - 220px);
}

.page-header {
  padding: 2rem 0 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.page-header h1 {
  margin-bottom: 0.35rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  list-style: none;
  padding: 0;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  opacity: 0.5;
}

.prose {
  max-width: 72ch;
  color: var(--text-secondary);
}

.prose h2, .prose h3 {
  margin-top: 1.75em;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 4rem;
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.78);
  padding: 3rem 0 1.5rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
}

.site-footer a:hover {
  color: var(--accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-brand .brand {
  color: #fff;
  margin-bottom: 0.85rem;
}

.footer-brand .brand__text {
  color: #fff;
}

.footer-brand p {
  font-size: 0.92rem;
  max-width: 36ch;
  line-height: 1.55;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.85rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-col li a {
  font-size: 0.92rem;
}

.footer-disclosure {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.25rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.55);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- Dashboard shell ---------- */
.dash-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.dash-sidebar {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.dash-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.25rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}

.dash-sidebar__brand:hover {
  color: #fff;
}

.dash-sidebar__brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.dash-sidebar__brand span {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.dash-sidebar__panel {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.85rem 1.15rem 0.35rem;
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.65rem 1rem;
  flex: 1;
}

.dash-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.92rem;
  font-weight: 550;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.dash-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.dash-nav a.is-active {
  background: var(--accent-soft);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.dash-sidebar__foot {
  padding: 1rem 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}

.dash-sidebar__foot a {
  color: rgba(255, 255, 255, 0.7);
}

.dash-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.dash-topbar h1 {
  font-size: 1.2rem;
  margin: 0;
}

.dash-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.dash-user__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.dash-content {
  padding: 1.5rem;
  flex: 1;
}

.dash-sidebar-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-card__label {
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.stat-card__value {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.stat-card__trend {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-card__trend--up { color: var(--success); }
.stat-card__trend--down { color: var(--danger); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.panel__head h2,
.panel__head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.panel__body {
  padding: 1.25rem;
}

.panel__body--flush {
  padding: 0;
}

/* Confirm dialog */
.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(7, 40, 68, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.confirm-backdrop.is-open {
  display: flex;
}

.confirm-dialog {
  width: min(100%, 400px);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  animation: fade-up 0.25s var(--ease);
}

.confirm-dialog h3 {
  margin-bottom: 0.5rem;
}

.confirm-dialog p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.confirm-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 550;
  background: var(--surface);
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination .is-active span,
.pagination .is-active a {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* CTA band */
.cta-band {
  background: linear-gradient(120deg, var(--navy) 0%, var(--navy-soft) 55%, #0d6aa8 100%);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: clamp(2rem, 4vw, 3rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: var(--shadow);
}

.cta-band h2 {
  color: #fff;
  margin-bottom: 0.4rem;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 40ch;
  margin: 0;
}

/* Markets ticker strip */
.ticker {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 0.75rem 0;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}

.ticker__item {
  display: inline-flex;
  gap: 0.45rem;
  white-space: nowrap;
  color: var(--text-secondary);
}

.ticker__item strong {
  color: var(--heading);
  font-weight: 650;
}

/* Mobile nav drawer (frontend) */
.site-nav-drawer {
  display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-grid,
  .blog-grid,
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }

  .dash-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 86vw);
    z-index: 60;
    transform: translateX(-105%);
    transition: transform 0.3s var(--ease);
  }

  .dash-layout.sidebar-open .dash-sidebar {
    transform: translateX(0);
  }

  .dash-layout.sidebar-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(7, 40, 68, 0.4);
    z-index: 55;
  }

  .dash-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .split,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav-drawer {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem 1rem;
    box-shadow: var(--shadow);
    flex-direction: column;
    gap: 0.25rem;
    z-index: 99;
  }

  .site-nav-drawer.is-open {
    display: flex;
  }

  .site-nav-drawer a {
    color: var(--text-secondary);
    font-weight: 550;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-sm);
  }

  .site-nav-drawer a:hover,
  .site-nav-drawer a.is-active {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .site-header {
    position: sticky;
  }

  .header-actions .btn-secondary {
    display: none;
  }

  .rate-matrix-section {
    margin-top: -1.5rem;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 76px;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .plan-grid,
  .blog-grid,
  .feature-grid,
  .form-row,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .brand__text {
    font-size: 1rem;
    max-width: 140px;
  }

  .hero {
    min-height: 70vh;
    align-items: flex-end;
  }

  .hero__content {
    margin-left: 1rem;
    margin-right: 1rem;
    width: auto;
  }

  .dash-content {
    padding: 1rem;
  }

  .dash-topbar {
    padding: 0.75rem 1rem;
  }

  .cta-band {
    text-align: center;
    justify-content: center;
  }

  .cta-band .btn {
    width: 100%;
  }

  .auth-card {
    margin: 1.5rem auto;
    padding: 1.5rem;
  }
}

/* Utility: lift on hover for interactive surfaces */
.lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

/* Aliases used by dashboard views */
.form-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.65rem;
}
.btn-soft {
  background: var(--surface-2, #e2e8f0);
  color: var(--heading);
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.text-muted { color: var(--text-muted); }
.dash-page-head { margin-bottom: 1.25rem; }
.dash-page-head h1 { margin: 0 0 0.25rem; font-family: var(--font-display); font-size: 1.45rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.code-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; }
.stat-card span { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.stat-card strong { font-size: 1.35rem; font-family: var(--font-display); color: var(--heading); }
