:root {
  --ivory: #f6f0e4;
  --ivory-soft: #efe7d4;
  --ink: #13231f;
  --ink-soft: #21463d;
  --brass: #caa868;
  --brass-soft: #e4c98d;
  --forest: #0f1d1b;
  --forest-soft: #112822;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(18, 35, 31, 0.88);
  --line: rgba(19, 35, 31, 0.12);
  --line-light: rgba(255, 255, 255, 0.12);
  --muted: rgba(19, 35, 31, 0.68);
  --muted-light: rgba(238, 240, 236, 0.7);
  --danger: #c76d5a;
  --success: #7ebf97;
  --shadow: 0 18px 42px rgba(8, 17, 15, 0.14);
  --max: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  background: var(--ivory);
  color: var(--ink);
  line-height: 1.6;
}

body.portal {
  background: linear-gradient(180deg, #0a1512 0%, #0d1816 100%);
  color: #edf3f2;
}

a {
  color: inherit;
  text-decoration: none;
}

img { max-width: 100%; display: block; }

button, input, select, textarea {
  font: inherit;
}

.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(246, 240, 228, 0.88);
  border-bottom: 1px solid var(--line);
}

body.portal .site-header {
  background: rgba(10, 21, 18, 0.8);
  border-bottom-color: var(--line-light);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 80px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-size: 0.68rem;
}

.brand-copy strong {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
}

.brand-copy span {
  color: var(--muted);
  letter-spacing: 0.18em;
}

body.portal .brand-copy span {
  color: var(--muted-light);
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.main-nav a {
  position: relative;
  font-size: 0.94rem;
  color: var(--muted);
  transition: color 0.18s ease;
}

body.portal .main-nav a {
  color: rgba(238, 243, 242, 0.72);
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--ink);
}

body.portal .main-nav a:hover,
body.portal .main-nav a.active {
  color: var(--brass-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.7; cursor: wait; }

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #f4efe3;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

body.portal .btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-light);
  color: #edf3f2;
}

.section {
  padding: 76px 0;
}

.hero {
  padding-top: 42px;
  padding-bottom: 70px;
}

.hero-grid,
.contact-grid,
.dashboard-grid,
.transfer-layout,
.two-column {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 52px;
  align-items: start;
}

body.portal .portal-shell {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  margin-top: 24px;
}

.kicker {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--brass);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

body.portal .kicker {
  color: var(--brass-soft);
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.05em;
  font-family: "Playfair Display", serif;
}

h1 {
  font-size: clamp(2.8rem, 5vw, 5.3rem);
  max-width: 620px;
}

h2 { font-size: clamp(1.8rem, 2.6vw, 2.7rem); }

h3 { font-size: clamp(1.5rem, 2vw, 2rem); }

.lead,
.section-copy {
  margin-top: 26px;
  max-width: 54ch;
  color: rgba(19, 35, 31, 0.7);
  font-size: 1.14rem;
  font-family: "Lora", serif;
}

body.portal .lead,
body.portal .section-copy,
body.portal .muted,
body.portal .table-card td,
body.portal .table-card th,
body.portal .contact-list li,
body.portal .policy-item p,
body.portal .service-item p,
body.portal .list-check li,
body.portal .payee-note,
body.portal .meta-line {
  color: rgba(237, 243, 242, 0.72);
}

.fact-list,
.contact-list,
.policy-list,
.list-check,
.service-list {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
}

.fact-list {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.fact-list li,
.contact-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(19, 35, 31, 0.08);
}

body.portal .fact-list li,
body.portal .contact-list li {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.fact-list li:last-child,
.contact-list li:last-child { border-bottom: none; }

.fact-list span { color: rgba(19, 35, 31, 0.68); }

body.portal .fact-list span,
body.portal .contact-list span {
  color: rgba(237, 243, 242, 0.7);
}

.fact-list strong,
.contact-list strong {
  color: var(--ink);
  font-weight: 600;
}

body.portal .fact-list strong,
body.portal .contact-list strong {
  color: #edf3f2;
}

.auth-card,
.info-card,
.panel,
.account-card,
.table-card,
.service-item,
.virtual-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

body.portal .auth-card,
body.portal .info-card,
body.portal .panel,
body.portal .account-card,
body.portal .table-card,
body.portal .virtual-card {
  border-color: var(--line-light);
  background: rgba(255, 255, 255, 0.012);
}

.auth-card {
  padding: 30px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.auth-header h2 {
  font-size: clamp(1.9rem, 2.5vw, 2.5rem);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(202, 168, 104, 0.42);
  background: rgba(202, 168, 104, 0.08);
  color: var(--brass);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0 10px;
}

.form-group { margin-bottom: 18px; }

label {
  display: block;
  margin-bottom: 8px;
  color: rgba(19, 35, 31, 0.7);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

body.portal label {
  color: rgba(237, 243, 242, 0.7);
}

input, select, textarea {
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(19, 35, 31, 0.14);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  padding: 0 14px;
}

body.portal input,
body.portal select,
body.portal textarea {
  border-color: var(--line-light);
  color: #edf3f2;
  background: rgba(255, 255, 255, 0.02);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(202, 168, 104, 0.9);
  box-shadow: 0 0 0 3px rgba(202, 168, 104, 0.18);
}

textarea { min-height: 126px; padding-top: 12px; resize: vertical; }

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 16px 0 22px;
}

.checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(19, 35, 31, 0.72);
  font-size: 0.82rem;
}

body.portal .checkbox-wrap {
  color: rgba(237, 243, 242, 0.72);
}

.checkbox-wrap input {
  width: 16px;
  height: 16px;
  accent-color: var(--brass);
}

.form-note {
  color: rgba(19, 35, 31, 0.66);
  font-size: 0.72rem;
  text-align: center;
  margin-top: 12px;
}

body.portal .form-note {
  color: rgba(237, 243, 242, 0.7);
}

.form-message {
  min-height: 20px;
  margin-top: 14px;
  color: var(--danger);
  font-size: 0.8rem;
}

.loading-box {
  padding: 16px 12px 8px;
  text-align: center;
}

.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 18px;
  border: 3px solid rgba(19, 35, 31, 0.12);
  border-top-color: var(--brass);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

body.portal .spinner {
  border-color: rgba(255,255,255,0.12);
  border-top-color: var(--brass);
}

.progress {
  width: 100%;
  height: 8px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(19, 35, 31, 0.08);
}

body.portal .progress {
  background: rgba(255,255,255,0.08);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brass), var(--brass-soft));
  transition: width 0.7s ease;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-header {
  padding: 54px 0 18px;
}

.page-header h1 {
  font-size: clamp(2.5rem, 4vw, 4.2rem);
}

.muted {
  color: rgba(19, 35, 31, 0.68);
}

body.portal .muted {
  color: rgba(237, 243, 242, 0.7);
}

.timeline,
.policy-list,
.card-stack {
  display: grid;
  gap: 18px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

body.portal .timeline-item { border-bottom-color: rgba(255,255,255,0.08); }

.timeline-year {
  color: var(--brass);
  font-weight: 700;
}

.list-check {
  display: grid;
  gap: 16px;
}

.list-check li {
  position: relative;
  padding-left: 22px;
  color: rgba(19, 35, 31, 0.76);
}

body.portal .list-check li {
  color: rgba(237, 243, 242, 0.74);
}

.list-check li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--brass);
  font-size: 1.7rem;
  line-height: 1;
}

.service-item {
  display: grid;
  grid-template-columns: 220px 1.2fr 0.9fr;
  gap: 24px;
  align-items: start;
  padding: 26px 24px;
  margin-top: 18px;
}

.service-item p,
.policy-item p,
.section-copy,
.payee-note,
.meta-line {
  margin: 0;
  font-family: "Lora", serif;
  color: rgba(19, 35, 31, 0.74);
}

body.portal .service-item p,
body.portal .policy-item p,
body.portal .payee-note,
body.portal .meta-line {
  color: rgba(237, 243, 242, 0.72);
}

.service-list {
  display: grid;
  gap: 8px;
}

.service-list li {
  color: rgba(19, 35, 31, 0.8);
}

body.portal .service-list li {
  color: rgba(237, 243, 242, 0.8);
}

.account-card {
  padding: 28px;
  background: rgba(255,255,255,0.02);
}

.account-balance {
  margin-top: 18px;
  font-size: clamp(2.4rem, 4vw, 4.7rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.08em;
}

.account-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(237, 243, 242, 0.7);
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.metric {
  padding: 18px 16px;
  border: 1px solid var(--line-light);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
}

.metric span {
  display: block;
  margin-bottom: 10px;
  color: rgba(237, 243, 242, 0.66);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  margin-top: 18px;
}

.quick-card {
  display: block;
  padding: 18px 16px;
  border-radius: 14px;
  background: var(--ivory);
  color: var(--ink);
  border: 1px solid rgba(19,35,31,0.12);
}

.quick-card .small {
  display: block;
  margin-bottom: 8px;
  color: rgba(19,35,31,0.5);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.quick-card strong {
  font-size: 1.12rem;
}

.table-card {
  overflow: hidden;
  margin-top: 26px;
}

.table-card table {
  width: 100%;
  border-collapse: collapse;
}

.table-card th,
.table-card td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.table-card th {
  background: rgba(255,255,255,0.02);
  color: rgba(237,243,242,0.66);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.table-card td {
  color: rgba(237,243,242,0.82);
}

.positive { color: var(--brass-soft); }
.negative { color: rgba(237,243,242,0.82); }

.transfer-layout {
  margin-top: 28px;
}

.payee-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  border: 1px solid var(--line-light);
  border-radius: 18px;
  overflow: hidden;
}

.payee-list li {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.payee-list li:last-child { border-bottom: none; }

.payee-list strong { display: block; }

.payee-list span {
  display: block;
  margin-top: 7px;
  color: rgba(237,243,242,0.62);
  font-size: 0.82rem;
}

.success-box {
  display: none;
  margin-bottom: 18px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid rgba(126, 191, 151, 0.38);
  background: rgba(126, 191, 151, 0.1);
  color: #edf3f2;
}

.success-box.visible { display: block; }

.virtual-card {
  min-height: 170px;
  padding: 22px 20px;
  background: linear-gradient(135deg, rgba(202,168,104,0.2), rgba(255,255,255,0.04));
  border-color: rgba(202,168,104,0.38);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.virtual-card .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.chip {
  width: 52px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(255,255,255,0.16));
}

.footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 18px;
  color: var(--muted);
}

body.portal .footer {
  border-top-color: var(--line-light);
  color: rgba(237,243,242,0.72);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 18px;
}

.footer-brand {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
}

body.portal .footer-brand {
  color: #edf3f2;
}

.footer-address,
.footer-list a,
.footer-bottom {
  color: rgba(19,35,31,0.7);
}

body.portal .footer-address,
body.portal .footer-list a,
body.portal .footer-bottom {
  color: rgba(237,243,242,0.7);
}

.footer-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

body.portal .footer-title {
  color: #edf3f2;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.footer-bottom {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
}

body.portal .footer-bottom {
  border-top-color: var(--line-light);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  margin-top: 28px;
}

@media (max-width: 900px) {
  .hero-grid,
  .contact-grid,
  .dashboard-grid,
  .portal-shell,
  .transfer-layout,
  .two-column,
  .service-item,
  .admin-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .main-nav {
    gap: 12px 18px;
  }
}

@media (max-width: 640px) {
  .site-header .container {
    flex-wrap: wrap;
    justify-content: center;
    padding: 14px 0;
  }

  .main-nav {
    width: 100%;
    justify-content: center;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }

  .quick-actions,
  .account-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    display: block;
  }

  .section {
    padding: 58px 0;
  }
}
