/* =========================================================================
   ENHANCE.CSS — global UI polish layer (loaded LAST on every page)
   -------------------------------------------------------------------------
   PURELY ADDITIVE. Uses ONLY the existing theme variables, so the white +
   green palette is unchanged. Touches only visual properties (shadow, border,
   radius, transition, hover/focus transform) — never layout structure — so it
   can't break the existing grid/flex layouts. Remove this one <link> to revert
   the entire pass. Mobile-refined + respects prefers-reduced-motion.
   ========================================================================= */

/* ---------- global niceties ---------- */
html { scroll-behavior: smooth; }
* { -webkit-tap-highlight-color: rgba(43,58,38,.12); }

/* refined custom scrollbar (green-tinted, matches theme) */
* { scrollbar-width: thin; scrollbar-color: rgba(43,58,38,.35) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--green), var(--green-deep));
  border-radius: 999px; border: 2px solid var(--paper);
}
*::-webkit-scrollbar-thumb:hover { background: var(--green-deep); }

/* crisp, consistent keyboard focus ring everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--green-2);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------- buttons ---------- */
.btn {
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s, filter .22s, background .25s;
  will-change: transform;
}
.btn-primary {
  box-shadow: 0 8px 20px rgba(43,58,38,.26), 0 1px 0 rgba(255,255,255,.18) inset;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(43,58,38,.34), 0 1px 0 rgba(255,255,255,.22) inset; filter: brightness(1.03); }
.btn-ghost:hover, .btn-outline:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(24,30,22,.14); }
.btn:active { transform: translateY(0) scale(.985); }
.btn .arrow { transition: transform .22s; display: inline-block; }
.btn:hover .arrow { transform: translateX(3px); }

.copy-btn { transition: transform .2s, box-shadow .2s, background .2s; }
.copy-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(43,58,38,.2); }
.copy-btn:active { transform: translateY(0) scale(.97); }

/* ---------- cards (landing + dashboard) ---------- */
.card, .about-card, .feature, .plan, .step, .level-card, .modal-card, .cong-card, .ref-meta {
  transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s, border-color .28s;
}
.card {
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 10px 30px rgba(24,30,22,.07);
}
.card:hover { box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 16px 40px rgba(24,30,22,.11); }
.feature:hover, .plan:hover, .about-card:hover, .level-card:hover, .step:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 50px rgba(24,30,22,.13);
  border-color: var(--line-strong);
}

/* card headers get a whisper of depth so the title band reads cleanly */
.card-head {
  background: linear-gradient(180deg, var(--paper), var(--bg-2));
  border-bottom: 1px solid var(--line);
}

/* ---------- stat cards (dashboard wallets) ---------- */
.stat-card {
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s;
  box-shadow: 0 6px 18px rgba(24,30,22,.06);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(24,30,22,.12); }
/* keep an accent rail at the top so the wallet cards feel intentional */
.stat-card { position: relative; overflow: hidden; }
.stat-card::after {
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--green), var(--green-2));
  opacity: .85; transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.stat-card:hover::after { transform: scaleX(1); }
.stat-card.green::after { background: rgba(255,255,255,.5); }
.stat-card.warn::after { background: linear-gradient(90deg, var(--warn, #a37709), #d6a23a); }
.stat-card .v { letter-spacing: -.01em; }

/* ---------- inputs / forms ---------- */
.field input, .field select, .field textarea {
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(79,138,90,.16);
  outline: none;
}
.field input:hover:not(:focus), .field select:hover:not(:focus), .field textarea:hover:not(:focus) {
  border-color: var(--line-strong);
}

/* ---------- tables ---------- */
.tbl-scroll { border-radius: 12px; }
table thead th {
  background: var(--green-pale);
  color: var(--green-deep);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 800;
  position: sticky; top: 0; z-index: 1;
}
table tbody tr { transition: background .15s; }
table tbody tr:hover td { background: rgba(43,58,38,.045); }
table tbody tr:not(:last-child) td { border-bottom: 1px solid var(--line); }

/* ---------- badges / chips ---------- */
.badge { transition: transform .2s, box-shadow .2s; box-shadow: 0 2px 6px rgba(24,30,22,.06); }
.balance-chip { box-shadow: 0 6px 16px rgba(43,58,38,.12); transition: transform .2s, box-shadow .2s; }
.balance-chip:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(43,58,38,.18); }

/* ---------- dashboard shell depth (visual only) ---------- */
.topbar { box-shadow: 0 4px 18px rgba(24,30,22,.05); }
.sidebar { box-shadow: 8px 0 28px rgba(24,30,22,.05); }
.menu a { transition: background .2s, color .2s, padding-left .2s; border-radius: 10px; }
.menu a:hover { background: var(--green-pale); padding-left: 4px; }
.menu a.active { box-shadow: 0 6px 16px rgba(43,58,38,.18); }
.menu-toggle { transition: transform .2s, border-color .2s, background .2s; }
.menu-toggle:hover { transform: translateY(-1px); }

/* ---------- landing nav ---------- */
.nav-cta .btn { transition: transform .22s, box-shadow .22s, filter .22s; }
.brand-mark { transition: transform .3s, box-shadow .3s; }
.brand:hover .brand-mark { transform: rotate(-4deg) scale(1.05); box-shadow: 0 12px 26px rgba(43,58,38,.32); }

/* ---------- receiver / sender boxes (P2P) ---------- */
.receiver-box { transition: box-shadow .25s, transform .25s; }
.receiver-box.show { box-shadow: 0 10px 28px rgba(24,30,22,.1); }

/* ---------- alerts ---------- */
.alert.show { box-shadow: 0 8px 22px rgba(24,30,22,.08); }

/* ---------- gentle reveal for active content (subtle, premium) ---------- */
.content.active > .card,
.content.active > .stats > .stat-card,
.content.active > .dubai-panel {
  animation: ehFadeUp .45s cubic-bezier(.2,.8,.2,1) both;
}
.content.active > .stats > .stat-card:nth-child(2) { animation-delay: .04s; }
.content.active > .stats > .stat-card:nth-child(3) { animation-delay: .08s; }
.content.active > .stats > .stat-card:nth-child(4) { animation-delay: .12s; }
.content.active > .stats > .stat-card:nth-child(5) { animation-delay: .16s; }
@keyframes ehFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* =========================================================================
   MOBILE refinements (<=640px) — comfortable tap targets + breathing room
   ========================================================================= */
@media (max-width: 640px) {
  .btn { min-height: 46px; }
  .btn-sm { min-height: 38px; }
  .copy-btn { min-height: 44px; }
  .field input, .field select, .field textarea { min-height: 46px; font-size: 16px; } /* 16px stops iOS zoom-on-focus */
  .menu a { min-height: 44px; display: flex; align-items: center; }
  /* slightly tighter card interiors so more fits without feeling cramped */
  .card-body { padding-left: 16px; padding-right: 16px; }
  table thead th, table tbody td { padding-left: 12px; padding-right: 12px; }
  /* disable card hover-lift on touch (no hover) so nothing feels stuck */
  .card:hover, .feature:hover, .plan:hover, .about-card:hover,
  .level-card:hover, .step:hover, .stat-card:hover { transform: none; }
}

/* =========================================================================
   accessibility — calm everything for reduced-motion users
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, .btn, .card, .stat-card, .feature, .plan, .about-card, .menu a,
  .content.active > .card, .content.active > .stats > .stat-card {
    animation: none !important;
    transition: none !important;
  }
  .btn:hover, .card:hover, .stat-card:hover, .feature:hover, .plan:hover { transform: none !important; }
}
