/* ============================================================
   VANA GOLD — App / product styles
   Builds on assets/vana-gold.css tokens. RTL / Persian.
   Used by auth, KYC, dashboard, wallet, buy, sell, referral, rules.
   ============================================================ */

/* ---------- Form primitives ---------- */
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field > label { font-size: 14px; color: var(--tx-mid); font-weight: 500; }
.field .hint { font-size: 12.5px; color: var(--tx-lo); }
.field .err { font-size: 12.5px; color: var(--down); display: none; }
.field.invalid .err { display: block; }

.input {
  width: 100%; height: 54px; padding-inline: 16px;
  background: var(--ink-200); color: var(--tx-hi);
  border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  font-family: inherit; font-size: 16px; transition: border-color .2s, background .2s, box-shadow .2s;
}
.input::placeholder { color: var(--tx-lo); }
.input:focus { outline: none; border-color: var(--g-500); background: var(--ink-150);
  box-shadow: 0 0 0 4px rgba(212,175,55,0.1); }
textarea.input { height: auto; padding-block: 14px; resize: vertical; line-height: 1.7; }

/* input with leading affix (e.g. phone +98 / ریال) */
.input-group { display: flex; align-items: stretch; gap: 0;
  background: var(--ink-200); border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  transition: border-color .2s, box-shadow .2s; overflow: hidden; }
.input-group:focus-within { border-color: var(--g-500); box-shadow: 0 0 0 4px rgba(212,175,55,0.1); }
.input-group .affix { display: grid; place-items: center; padding-inline: 16px; font-size: 15px;
  color: var(--tx-mid); background: rgba(255,255,255,0.03); border-inline-start: 1px solid var(--line-soft);
  white-space: nowrap; }
.input-group .input { border: 0; background: transparent; box-shadow: none; }
.input-group .input:focus { box-shadow: none; }
.input-group.ltr .input { direction: ltr; text-align: right; letter-spacing: .04em; }

/* segmented tabs (login / register) */
.seg { display: grid; grid-auto-flow: column; gap: 4px; padding: 5px;
  background: var(--ink-200); border-radius: var(--r-sm); border: 1px solid var(--line-soft); }
.seg button { border: 0; background: transparent; color: var(--tx-mid); font-family: inherit;
  font-size: 15px; font-weight: 600; padding: 11px 14px; border-radius: calc(var(--r-sm) - 3px);
  transition: .2s; }
.seg button.active { background: var(--accent-grad); color: #2a1f04; }

/* checkbox row */
.check { display: flex; align-items: flex-start; gap: 11px; font-size: 14px; color: var(--tx-mid); line-height: 1.6; }
.check input { appearance: none; width: 22px; height: 22px; flex: none; margin-top: 1px;
  border: 1.5px solid var(--line); border-radius: 7px; background: var(--ink-200); cursor: pointer; position: relative; transition: .15s; }
.check input:checked { background: var(--accent-grad); border-color: transparent; }
.check input:checked::after { content: ""; position: absolute; inset: 0; background: no-repeat center/14px
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232a1f04' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 6'/%3E%3C/svg%3E"); }
.check a { color: var(--accent-200); }

/* password field with a show/hide eye. The eye is pinned to the physical right edge because the input
   itself is forced to direction:ltr — that is where a latin password ends, whatever the page direction. */
.pw { position: relative; }
.pw .input { padding-right: 50px; }
.pw-eye { position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 10px;
  background: none; color: var(--tx-lo); cursor: pointer; transition: color .15s, background .15s; }
.pw-eye:hover { color: var(--tx-mid); background: rgba(255,255,255,0.04); }
.pw-eye svg { width: 19px; height: 19px; }
.pw-eye.on { color: var(--accent-200); }

/* standalone error line (outside .field, where .field .err would hide it) */
.err { font-size: 13.5px; color: var(--down); line-height: 1.8; }

/* small link line under a field, e.g. «رمز عبور را فراموش کرده‌اید؟» */
.auth-mini { margin: -6px 0 20px; font-size: 13.5px; text-align: left; }
.auth-mini a { color: var(--accent-200); font-weight: 600; }

/* «کاربر قدیمی» hint under the login button — quieter than .auth-note, it is guidance not an alert */
.auth-legacy { display: flex; gap: 9px; align-items: flex-start; margin-top: 18px;
  font-size: 13px; line-height: 1.95; color: var(--tx-lo); }
.auth-legacy svg { width: 17px; height: 17px; flex: none; margin-top: 4px; color: var(--accent-200); }
.auth-legacy b { color: var(--tx-mid); font-weight: 600; }
.auth-legacy a { color: var(--accent-200); font-weight: 600; }

/* explanatory banner inside an auth step */
.auth-note { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 20px;
  padding: 13px 15px; border-radius: var(--r-sm); line-height: 1.85; font-size: 13.5px; color: var(--tx-mid);
  background: rgba(212,175,55,0.08); border: 1px solid rgba(212,175,55,0.28); }
.auth-note svg { width: 19px; height: 19px; flex: none; margin-top: 3px; color: var(--accent-200); }
.auth-note b { color: var(--tx-hi); display: block; margin-bottom: 2px; }

/* OTP boxes */
.otp { display: flex; gap: 10px; direction: ltr; justify-content: center; }
.otp input { width: 54px; height: 64px; text-align: center; font-size: 26px; font-weight: 700;
  background: var(--ink-200); color: var(--tx-hi); border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  transition: .2s; }
.otp input:focus { outline: none; border-color: var(--g-500); box-shadow: 0 0 0 4px rgba(212,175,55,0.1); background: var(--ink-150); }
.otp input.filled { border-color: var(--g-600); }

/* ---------- Auth layout ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; position: relative; z-index: 1; }
.auth-main { position: relative; z-index: 1; }
.kyc-wrap { position: relative; z-index: 1; }
.auth-aside { position: relative; overflow: hidden; padding: 56px 56px 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  border-inline-start: 1px solid var(--line);
  background:
    radial-gradient(700px 420px at 80% 10%, rgba(212,175,55,0.16), transparent 60%),
    radial-gradient(600px 500px at 10% 90%, rgba(190,140,40,0.10), transparent 60%),
    var(--ink-000); }
.auth-aside .brand img { height: 46px; }
.auth-aside-coin { position: absolute; inset-inline-end: -80px; top: 50%; transform: translateY(-50%);
  width: 460px; opacity: .14; filter: drop-shadow(0 30px 60px rgba(0,0,0,.6)); pointer-events: none; }
.auth-aside h2 { font-size: clamp(28px, 3vw, 40px); position: relative; z-index: 1; }
.auth-aside p { color: var(--tx-mid); font-size: 17px; margin-top: 16px; max-width: 360px; position: relative; z-index: 1; }
.auth-aside .bullets { display: grid; gap: 16px; margin-top: 30px; position: relative; z-index: 1; }
.auth-aside .bullets li { display: flex; gap: 12px; align-items: center; color: var(--tx-hi); font-size: 15.5px; list-style: none; }
.auth-aside .bullets .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(212,175,55,0.12); border: 1px solid var(--line); color: var(--accent-200); flex: none; }
.auth-aside .bullets .ic svg { width: 19px; height: 19px; }

.auth-main { display: grid; place-items: center; padding: 40px 28px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand-sm { display: none; align-items: center; gap: 10px; justify-content: center; margin-bottom: 28px; }
.auth-card .brand-sm img { height: 42px; }
.auth-head { margin-bottom: 26px; }
.auth-head h1 { font-size: 28px; }
.auth-head p { color: var(--tx-mid); font-size: 15px; margin-top: 8px; }
.auth-foot { text-align: center; margin-top: 22px; font-size: 14px; color: var(--tx-mid); }
.auth-foot a { color: var(--accent-200); font-weight: 600; }
.auth-back { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--tx-mid);
  background: none; border: 0; font-family: inherit; cursor: pointer; margin-bottom: 18px; }
.auth-back svg { width: 16px; height: 16px; }
.otp-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; font-size: 14px; color: var(--tx-mid); }
.otp-meta button { background: none; border: 0; color: var(--accent-200); font-family: inherit; font-weight: 600; cursor: pointer; }
.otp-meta button:disabled { color: var(--tx-lo); cursor: default; }
.phone-edit { color: var(--tx-hi); font-weight: 600; }

/* step visibility */
.auth-step { display: none; }
.auth-step.active { display: block; animation: fadeUp .4s ease; }
@keyframes fadeUp { from { transform: translateY(10px); } to { transform: none; } }

/* ---------- KYC ---------- */
.kyc-wrap { min-height: 100vh; }
.kyc-top { border-bottom: 1px solid var(--line-soft); background: color-mix(in srgb, var(--ink-050) 84%, transparent);
  backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.kyc-top-in { display: flex; align-items: center; gap: 18px; height: 72px; }
.kyc-top .brand img { height: 38px; }
.kyc-exit { margin-inline-start: auto; font-size: 14px; color: var(--tx-mid); }

.kyc-main { max-width: 760px; margin-inline: auto; padding: 40px 28px 80px; }

/* stepper */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 40px; }
.stepper .stp { display: flex; align-items: center; gap: 12px; }
.stepper .num { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; flex: none;
  background: var(--ink-200); color: var(--tx-lo); border: 1px solid var(--line-soft); transition: .3s; }
.stepper .lbl { font-size: 14.5px; color: var(--tx-lo); font-weight: 500; transition: .3s; white-space: nowrap; }
.stepper .bar { flex: 1; height: 2px; background: var(--line-soft); margin-inline: 14px; min-width: 24px; }
.stepper .stp.active .num { background: var(--accent-grad); color: #2a1f04; border-color: transparent; }
.stepper .stp.active .lbl { color: var(--tx-hi); }
.stepper .stp.done .num { background: rgba(212,175,55,0.14); color: var(--accent-200); border-color: var(--line); }
.stepper .stp.done .lbl { color: var(--tx-mid); }

.kyc-card { padding: clamp(24px, 3vw, 38px); }
.kyc-card h2 { font-size: 24px; }
.kyc-card > p.sub { color: var(--tx-mid); font-size: 15px; margin-top: 8px; margin-bottom: 28px; }
.kyc-actions { display: flex; gap: 12px; margin-top: 30px; }
.kyc-actions .btn { flex: 1; }

/* upload dropzone */
.drop { display: block; border: 1.5px dashed var(--line); border-radius: var(--r); background: rgba(255,255,255,0.015);
  padding: 32px 24px; text-align: center; cursor: pointer; transition: .2s; position: relative; overflow: hidden; }
.drop:hover { border-color: var(--g-500); background: rgba(212,175,55,0.05); }
.drop .dz-ic { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px; display: grid; place-items: center;
  background: rgba(212,175,55,0.1); border: 1px solid var(--line); color: var(--accent-200); }
.drop .dz-ic svg { width: 30px; height: 30px; }
.drop h4 { font-size: 16.5px; }
.drop p { color: var(--tx-lo); font-size: 13px; margin-top: 6px; }
.drop.has-file { border-style: solid; border-color: var(--g-600); }
.drop .preview { position: absolute; inset: 0; display: none; }
.drop.has-file .preview { display: block; }
.drop.has-file .dz-inner { opacity: 0; }
.drop .preview img { width: 100%; height: 100%; object-fit: cover; }
.drop .preview .ok { position: absolute; inset-inline-end: 12px; top: 12px; width: 34px; height: 34px;
  border-radius: 50%; background: var(--up); display: grid; place-items: center; }
.drop .preview .ok svg { width: 18px; height: 18px; color: #06281a; }

/* selfie example illustration */
.selfie-guide { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r-sm);
  background: rgba(212,175,55,0.06); border: 1px solid var(--line); margin-bottom: 22px; }
.selfie-guide .gic { width: 46px; height: 46px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--ink-200); color: var(--accent-200); border: 1px solid var(--line); }
.selfie-guide p { font-size: 13.5px; color: var(--tx-mid); line-height: 1.6; }

/* kyc reference (how-to) block */
.kyc-ref { display: grid; grid-template-columns: 280px 1fr; gap: 22px; align-items: stretch; margin-bottom: 26px; }
.kyc-ref-img { position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line);
  background: var(--ink-100); display: grid; place-items: center; padding: 10px; }
.kyc-ref-img img { width: 100%; height: auto; display: block; }
.kyc-ref-tag { position: absolute; inset-block-start: 12px; inset-inline-start: 12px; font-size: 12px; font-weight: 700;
  color: #06281a; background: var(--up); padding: 4px 10px; border-radius: 999px; }
.kyc-ref-list { display: flex; flex-direction: column; justify-content: center; }
.kyc-ref-list h4 { font-size: 15px; margin-bottom: 14px; }
.kyc-ref-list ul { list-style: none; display: grid; gap: 12px; }
.kyc-ref-list li { display: flex; align-items: center; gap: 11px; font-size: 14px; color: var(--tx-mid); line-height: 1.5; }
.kyc-ref-list .ck, .kyc-ref-list .x { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.kyc-ref-list .ck { background: rgba(58,217,148,0.14); color: var(--up); }
.kyc-ref-list .x { background: rgba(255,93,108,0.14); color: var(--down); }
.kyc-ref-list .ck svg, .kyc-ref-list .x svg { width: 13px; height: 13px; }
@media (max-width: 620px) {
  .kyc-ref { grid-template-columns: 1fr; }
  .kyc-ref-img { max-width: 300px; margin-inline: auto; }
}

/* pending / success state */
.kyc-result { text-align: center; padding: 20px 10px 8px; }
.kyc-result .badge-ic { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 24px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(212,175,55,0.2), transparent 70%); border: 1px solid var(--line); }
.kyc-result .badge-ic svg { width: 46px; height: 46px; color: var(--accent-200); }
.kyc-result h2 { font-size: 26px; }
.kyc-result p { color: var(--tx-mid); font-size: 15.5px; margin: 12px auto 0; max-width: 420px; }

@media (max-width: 880px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-card .brand-sm { display: flex; }
  .stepper .lbl { display: none; }
  .stepper .bar { margin-inline: 8px; }
}
@media (max-width: 480px) {
  .otp input { width: 46px; height: 56px; font-size: 22px; }
  .otp { gap: 7px; }
}


/* ── Page-entry animation for auth / KYC ───────────────────── */
@keyframes vg-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
.auth-card {
  animation: vg-fade-up .6s cubic-bezier(.4,0,.2,1) both;
}
.kyc-main {
  animation: vg-fade-up .55s cubic-bezier(.4,0,.2,1) .05s both;
}
.kyc-top {
  animation: vg-fade-up .45s cubic-bezier(.4,0,.2,1) both;
}
@media (prefers-reduced-motion: reduce) {
  .auth-card, .kyc-main, .kyc-top { animation: none; }
}
