/* ===== Ambika Gold Valuation — dark theme ===== */
:root {
  --gold: #d4af37;
  --gold-lt: #f4d272;
  --gold-dk: #b8860b;
  --gold-soft: rgba(212, 175, 55, .14);
  --ink: #0c0d12;
  --ink-1: #14161d;
  --ink-2: #1b1e28;
  --ink-3: #232735;
  --line: rgba(255, 255, 255, .08);
  --txt: #eef0f6;
  --txt-dim: #9aa0b0;
  --txt-mute: #6d7385;
  --silver: #c9d4e0;
  --ok: #34d399;
  --err: #f87171;
  --radius: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--txt);
  background:
    radial-gradient(1000px 600px at 15% -10%, #23283a 0%, transparent 55%),
    radial-gradient(900px 500px at 110% 10%, #2a2416 0%, transparent 50%),
    var(--ink);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--gold-lt); text-decoration: none; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 18px; }

/* ===== Top bar ===== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  background: rgba(12, 13, 18, .72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { display: flex; align-items: center; gap: 12px; }
.topbar .brand img { width: 42px; height: 42px; border-radius: 12px; background: #fff; padding: 4px; }
.topbar .brand b { font-size: 1.05rem; letter-spacing: .3px; }
.topbar .brand b span {
  background: linear-gradient(90deg, var(--gold-lt), var(--gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.topbar .spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--ink-2); color: var(--txt); font: inherit; font-size: .9rem;
  font-weight: 500; cursor: pointer; transition: .2s ease;
}
.btn:hover { border-color: var(--gold-dk); transform: translateY(-1px); }
.btn-gold {
  border: none; color: #1a1a1a; font-weight: 600;
  background: linear-gradient(135deg, var(--gold-dk), var(--gold-lt));
  box-shadow: 0 10px 24px rgba(212, 175, 55, .35);
}
.btn-gold:hover { box-shadow: 0 14px 30px rgba(212, 175, 55, .5); }
.btn-ghost { background: transparent; }
.btn.loading { opacity: .7; pointer-events: none; }

/* ===== Section / hero ===== */
.section { padding: 30px 0; }
.hero-head { text-align: center; margin-bottom: 26px; }
.hero-head h1 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); font-weight: 700; }
.hero-head h1 .g {
  background: linear-gradient(90deg, var(--gold-lt), var(--gold), var(--gold-dk));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-head p { color: var(--txt-dim); margin-top: 8px; }

.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .18); animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); } }

/* ===== Rate cards ===== */
.rate-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
}
.rate-card {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px 16px; transition: .25s ease;
}
.rate-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(var(--gold-lt), var(--gold-dk));
}
.rate-card.silver::before { background: linear-gradient(#eef3f8, #7f8a99); }
.rate-card:hover { transform: translateY(-4px); border-color: var(--gold-dk); box-shadow: var(--shadow); }
.rate-tag {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-lt);
  text-transform: uppercase;
}
.rate-card.silver .rate-tag { background: rgba(201, 212, 224, .12); color: var(--silver); }
.rate-val { font-size: 1.7rem; font-weight: 700; margin-top: 12px; }
.rate-unit { color: var(--txt-mute); font-size: .82rem; margin-top: 2px; }
.rate-updated { text-align: center; color: var(--txt-mute); font-size: .82rem; margin-top: 14px; }

/* ===== Cards / panels ===== */
.panel {
  background: linear-gradient(160deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--line); border-radius: 20px; padding: 26px;
  box-shadow: var(--shadow);
}
.panel h2 { font-size: 1.25rem; margin-bottom: 4px; }
.panel .sub { color: var(--txt-dim); font-size: .9rem; margin-bottom: 20px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

/* ===== Forms ===== */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; color: var(--txt-dim); margin-bottom: 7px; font-weight: 500; }
.field input, .field textarea, .field select {
  width: 100%; padding: 13px 14px; font: inherit; font-size: .95rem;
  color: var(--txt); background: var(--ink-3); border: 1.5px solid var(--line);
  border-radius: 12px; outline: none; transition: .2s ease;
}
.field textarea { resize: vertical; min-height: 78px; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--gold); box-shadow: 0 0 0 4px rgba(212, 175, 55, .14);
}
.field input::placeholder, .field textarea::placeholder { color: var(--txt-mute); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.seg { display: inline-flex; background: var(--ink-3); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button, .seg .seg-item {
  border: none; background: transparent; color: var(--txt-dim); font: inherit; font-weight: 600;
  padding: 9px 20px; border-radius: 9px; cursor: pointer; transition: .2s ease;
}
.seg button.active {
  color: #1a1a1a; background: linear-gradient(135deg, var(--gold-dk), var(--gold-lt));
  box-shadow: 0 6px 16px rgba(212, 175, 55, .35);
}
.seg.silver-active button.active { background: linear-gradient(135deg, #7f8a99, #eef3f8); }

.karat-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.karat-opts label {
  flex: 1; min-width: 84px; text-align: center; cursor: pointer;
  padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--ink-3);
  transition: .2s ease; color: var(--txt); margin: 0; font-weight: 600;
}
.karat-opts input { display: none; }
.karat-opts input:checked + span { color: var(--gold-lt); }
.karat-opts label:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 3px rgba(212,175,55,.12); }

.btn-block { width: 100%; justify-content: center; padding: 15px; font-size: 1rem; }

.form-msg { display: none; margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-size: .88rem; }
.form-msg.ok { background: rgba(52, 211, 153, .12); border: 1px solid rgba(52, 211, 153, .4); color: var(--ok); }
.form-msg.err { background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .4); color: var(--err); }

/* ===== Result card ===== */
.result-card {
  margin-top: 18px; padding: 22px; border-radius: 16px; text-align: center;
  background: radial-gradient(120% 120% at 50% 0%, rgba(212,175,55,.16), var(--ink-2));
  border: 1px solid var(--gold-dk);
  opacity: 0; transform: translateY(10px); max-height: 0; overflow: hidden;
  transition: opacity .4s ease, transform .4s ease, max-height .4s ease, padding .4s ease;
  padding-top: 0; padding-bottom: 0;
}
.result-card.show { opacity: 1; transform: translateY(0); max-height: 400px; padding: 22px; }
.result-card .label { color: var(--txt-dim); font-size: .82rem; text-transform: uppercase; letter-spacing: 1px; }
.result-card .amount { font-size: 2.3rem; font-weight: 800; margin: 8px 0 4px;
  background: linear-gradient(90deg, var(--gold-lt), var(--gold)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.result-card .meta { color: var(--txt-dim); font-size: .9rem; }
.disclaimer {
  margin-top: 14px; font-size: .8rem; color: var(--txt-dim); line-height: 1.5;
  background: var(--ink-3); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px;
}
.disclaimer b { color: var(--gold-lt); }

/* ===== 3D chart ===== */
.chart-wrap { margin-top: 8px; }
.chart-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chart-3d { width: 100%; height: 460px; border-radius: 16px; background: radial-gradient(120% 120% at 50% 0%, #191d29, #0e0f15); border: 1px solid var(--line); }
.chart-3d.loading { position: relative; }
.chart-3d.loading::after { content: "Loading chart…"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--txt-mute); }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--txt-mute); }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
table.data { width: 100%; border-collapse: collapse; min-width: 820px; }
table.data th, table.data td { padding: 13px 14px; text-align: left; font-size: .88rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { background: var(--ink-3); color: var(--gold-lt); font-weight: 600; position: sticky; top: 0; }
table.data tr:hover td { background: rgba(255,255,255,.02); }
.pill { padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.pill.gold { background: var(--gold-soft); color: var(--gold-lt); }
.pill.silver { background: rgba(201,212,224,.12); color: var(--silver); }
.amt { color: var(--gold-lt); font-weight: 600; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--txt-mute); }

/* ===== Install modal ===== */
.modal { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; padding: 20px;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.modal.open { display: grid; }
.modal .box { width: 100%; max-width: 460px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.modal h3 { margin-bottom: 6px; }
.modal .steps { margin-top: 14px; }
.modal .steps ol { margin-left: 18px; color: var(--txt-dim); }
.modal .steps li { margin: 7px 0; }
.modal .plat-title { color: var(--gold-lt); font-weight: 600; margin-bottom: 6px; }
.modal .close { float: right; cursor: pointer; color: var(--txt-mute); font-size: 1.3rem; line-height: 1; }

.footer { text-align: center; color: var(--txt-mute); font-size: .78rem; padding: 26px 0 34px; }

/* ===== Valuation cards (mobile-first) ===== */
.val-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.val-card {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--line); border-radius: 18px; padding: 18px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .38); transition: .2s ease;
}
.val-card:hover { transform: translateY(-3px); border-color: var(--gold-dk); }
.val-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(var(--gold-lt), var(--gold-dk)); }
.val-card.silver::before { background: linear-gradient(#eef3f8, #7f8a99); }

.vc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.vc-name { font-size: 1.15rem; font-weight: 700; }
.vc-date { color: var(--txt-mute); font-size: .78rem; margin-top: 3px; }
.vc-date i { margin-right: 4px; }

.vc-amount {
  margin: 14px 0; padding: 12px 14px; border-radius: 12px;
  background: radial-gradient(120% 120% at 50% 0%, rgba(212,175,55,.16), var(--ink-3));
  border: 1px solid rgba(212,175,55,.28);
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.val-card.silver .vc-amount { background: radial-gradient(120% 120% at 50% 0%, rgba(201,212,224,.14), var(--ink-3)); border-color: rgba(201,212,224,.28); }
.vc-amt-label { color: var(--txt-dim); font-size: .74rem; text-transform: uppercase; letter-spacing: 1px; }
.vc-amt { font-size: 1.55rem; font-weight: 800; background: linear-gradient(90deg, var(--gold-lt), var(--gold)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.val-card.silver .vc-amt { background: linear-gradient(90deg, #eef3f8, #b7c2d0); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.vc-rows { display: grid; gap: 9px; }
.vc-row { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; }
.vc-row i { width: 16px; text-align: center; color: var(--gold); margin-top: 3px; }
.val-card.silver .vc-row i { color: var(--silver); }
.vc-row .k { color: var(--txt-mute); min-width: 78px; }
.vc-row .v { color: var(--txt); font-weight: 500; flex: 1; word-break: break-word; }

.vc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.vc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 12px; font-weight: 600; font-size: .92rem; border: none; cursor: pointer; transition: .2s ease; }
.vc-btn:hover { transform: translateY(-2px); }
.vc-wa { background: linear-gradient(135deg, #1faa53, #25d366); color: #06381b; box-shadow: 0 8px 18px rgba(37, 211, 102, .3); }
.vc-wa:hover { box-shadow: 0 12px 24px rgba(37, 211, 102, .45); color: #06381b; }
.vc-call { background: linear-gradient(135deg, var(--gold-dk), var(--gold-lt)); color: #1a1a1a; box-shadow: 0 8px 18px rgba(212, 175, 55, .3); }
.vc-call:hover { box-shadow: 0 12px 24px rgba(212, 175, 55, .45); color: #1a1a1a; }

@media (max-width: 560px) {
  .val-grid { grid-template-columns: 1fr; }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .rate-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .rate-grid { grid-template-columns: repeat(2, 1fr); }
  .rate-val { font-size: 1.4rem; }
  .panel { padding: 20px 16px; }
  .row-2 { grid-template-columns: 1fr; }
  .chart-3d { height: 380px; }
  .topbar .brand b { font-size: .95rem; }
}
