/* main.css - layout + decorative animations for Bzza VPN web pages. */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #0f0f1e;
  color: #e8e8f0;
  overflow-x: hidden;
}

/* RTL / Persian typography. Tahoma + system Persian fallback avoid a remote
   font dependency while keeping text legible in rtl flow. */
html[dir="rtl"] body {
  font-family: "Vazirmatn", "Segoe UI", Tahoma, "Iranian Sans", system-ui, sans-serif;
}
html[dir="rtl"] .nav-logo,
html[dir="rtl"] .hero-title,
html[dir="rtl"] .grad-text { letter-spacing: 0; } /* latin tracking hurts Persian */

/* i18n FOUC guard: hide body until the dictionary has been applied so users
   never see the fallback language flash before their detected one.
   - Templates start with <html class="i18n-nojs">.
   - i18n.js removes .i18n-nojs on boot, then adds .i18n-ready when done.
   - If JS is disabled, .i18n-nojs stays -> :not(.i18n-nojs) is false ->
     body remains visible (graceful degradation to the inline fallback text). */
html.i18n-nojs:not(.i18n-ready) body { visibility: visible; }
html:not(.i18n-nojs):not(.i18n-ready) body { visibility: hidden; }

/* ---- animated gradient backdrop ---- */
.bg-gradient {
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(-45deg, #0f0f1e, #1a1a3e, #16213e, #0f0c29);
  background-size: 400% 400%;
  animation: bgShift 16s ease infinite;
}
@keyframes bgShift {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}

/* ---- nav ---- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem clamp(1rem,5vw,4rem);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(15,15,30,.55);
}
.nav-logo { font-size: 1.4rem; font-weight: 800; letter-spacing: 1px; }
.nav-logo span { background: linear-gradient(90deg,#00cec9,#6c5ce7); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: .8rem; }

/* ---- hero ---- */
.hero { min-height: 78vh; display: grid; place-items: center; text-align: center; position: relative; }
.hero-inner { position: relative; z-index: 2; padding: 2rem; }
.hero-title { font-size: clamp(2.2rem,7vw,4.5rem); font-weight: 900; line-height: 1.1; }
.grad-text { background: linear-gradient(90deg,#00cec9,#a29bfe,#fd79a8); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: gradFlow 4s linear infinite; }
@keyframes gradFlow { to { background-position: 200% center; } }
.cursor { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-sub { margin: 1.2rem 0 2rem; color: #a0a0c0; font-size: 1.1rem; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* floating orbs */
.orbs { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .5; animation: floatOrb 14s ease-in-out infinite; }
.orb-1 { width: 240px; height: 240px; background: #6c5ce7; top: 10%; left: 8%; }
.orb-2 { width: 180px; height: 180px; background: #00cec9; bottom: 12%; right: 10%; animation-delay: -5s; }
.orb-3 { width: 140px; height: 140px; background: #fd79a8; top: 50%; left: 60%; animation-delay: -9s; }
@keyframes floatOrb {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(40px,-30px) scale(1.1); }
  66%     { transform: translate(-30px,25px) scale(.95); }
}

/* ---- features ---- */
.features, .page-head, .cta-strip { padding: 4rem clamp(1rem,5vw,4rem); text-align: center; }
.features h2, .page-head h1 { font-size: clamp(1.6rem,4vw,2.6rem); margin-bottom: 2.5rem; }
.page-head p { color: #a0a0c0; margin-top: .5rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 1.5rem; max-width: 1100px; margin: 0 auto; }
.feat-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px; padding: 1.8rem; transition: transform .3s, box-shadow .3s;
}
.feat-card:hover { transform: translateY(-8px); box-shadow: 0 18px 40px rgba(108,92,231,.3); }
.feat-icon { font-size: 2.4rem; margin-bottom: .8rem; }
.feat-card h3 { margin-bottom: .5rem; color: #a29bfe; }
.feat-card p { color: #b0b0d0; font-size: .95rem; }

/* ---- CTA strip ---- */
.cta-strip { background: linear-gradient(90deg, rgba(108,92,231,.15), rgba(0,206,201,.15)); }
.cta-strip h2 { margin-bottom: 1.5rem; }

/* ---- pricing ---- */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 2rem; max-width: 1100px; margin: 2rem auto; padding: 0 1rem; }
.price-card { }
.price-inner { position: relative; width: 100%; }
.price-face {
  border-radius: 20px; padding: 2rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
}
.price-back { display: none; }
.price-card.featured { transform: scale(1.05); }
.price-card.featured .price-face { border-color: #00cec9; box-shadow: 0 0 30px rgba(0,206,201,.25); }
.ribbon { position: absolute; top: -10px; right: 16px; background: #fd79a8; padding: .25em 1em; border-radius: 8px; font-size: .8rem; font-weight: 700; z-index: 3; }
.price-amt { font-size: 3rem; font-weight: 900; margin: .5rem 0; }
.price-amt .cur { font-size: 1.4rem; vertical-align: top; color: #a0a0c0; }
.price-amt .per { font-size: 1rem; color: #a0a0c0; }
.price-feats { list-style: none; margin: .5rem 0; text-align: left; width: 100%; }
.price-feats li { padding: .25rem 0; color: #c0c0d8; }
.badge { font-size: .7rem; background: #fd79a8; padding: .15em .6em; border-radius: 6px; vertical-align: middle; }
.badge.green { background: #00b894; }

/* comparison bars */
.compare { max-width: 700px; margin: 3rem auto; padding: 0 1rem; }
.compare h2 { text-align: center; margin-bottom: 1.5rem; }
.bar-row { display: flex; align-items: center; gap: 1rem; margin: .8rem 0; }
.bar-row span { width: 110px; text-align: right; color: #b0b0d0; }
.bar { flex: 1; height: 26px; border-radius: 13px; width: 0; }
.bar-us   { background: linear-gradient(90deg,#00cec9,#6c5ce7); }
.bar-them { background: linear-gradient(90deg,#fdcb6e,#e17055); }
.bar-free { background: #636e72; }

/* ---- register ---- */
.reg-wrap { max-width: 460px; margin: 2rem auto 4rem; padding: 0 1rem; }
.steps { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-bottom: 1.5rem; }
.step-dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.2); font-weight: 700; transition: all .4s; }
.step-dot.active { background: linear-gradient(135deg,#6c5ce7,#00cec9); border-color: transparent; box-shadow: 0 0 18px rgba(0,206,201,.5); }
.step-dot.done { background: #00b894; border-color: transparent; }
.step-line { width: 50px; height: 3px; background: rgba(255,255,255,.15); transition: background .4s; }
.step-line.fill { background: linear-gradient(90deg,#6c5ce7,#00cec9); }

.reg-card { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 20px; padding: 2rem; text-align: center; animation: cardIn .5s ease; }
@keyframes cardIn { from { opacity: 0; transform: translateY(20px); } }
.hidden { display: none; }
.reg-card h2 { margin-bottom: 1rem; }
.muted { color: #a0a0c0; font-size: .9rem; margin-bottom: 1.2rem; }
.reg-card label { display: block; text-align: left; margin-bottom: 1rem; color: #c0c0d8; font-size: .9rem; }
.reg-card input { width: 100%; margin-top: .4rem; padding: .8rem 1rem; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); background: rgba(0,0,0,.25); color: #fff; font-size: 1rem; transition: border .3s, box-shadow .3s; }
.reg-card input:focus { outline: none; border-color: #00cec9; box-shadow: 0 0 0 3px rgba(0,206,201,.2); }
.reg-card .btn { margin-top: 1rem; width: 100%; }

.pwd-strength { height: 6px; background: rgba(255,255,255,.1); border-radius: 3px; overflow: hidden; margin: .5rem 0 0; }
.pwd-bar { height: 100%; width: 0; background: #e17055; transition: width .4s, background .4s; }

/* spinner */
.spinner { width: 56px; height: 56px; border-radius: 50%; border: 4px solid rgba(255,255,255,.1); border-top-color: #00cec9; margin: 0 auto 1rem; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.check-pop { width: 80px; height: 80px; border-radius: 50%; background: #00b894; display: grid; place-items: center; margin: 0 auto 1rem; font-size: 2.4rem; animation: pop .5s cubic-bezier(.68,-.55,.27,1.55); }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* ---- footer ---- */
.footer { text-align: center; padding: 2rem; color: #707090; font-size: .85rem; border-top: 1px solid rgba(255,255,255,.06); }

/* ---- RTL layout mirroring ----
 * We use logical properties (margin-inline-start etc.) where the markup
 * already does; the rules below fix the few spots that used physical left/right
 * or whose flex/grid reading order should visually flip under [dir="rtl"].
 */
html[dir="rtl"] .nav { flex-direction: row-reverse; }
html[dir="rtl"] .nav-links { flex-direction: row-reverse; }
html[dir="rtl"] .hero-cta { flex-direction: row-reverse; }
html[dir="rtl"] .steps { flex-direction: row-reverse; }
html[dir="rtl"] .bar-row { flex-direction: row-reverse; }
html[dir="rtl"] .bar-row span { text-align: left; }
/* pricing feature lists read right-aligned in rtl */
html[dir="rtl"] .price-feats { text-align: right; }
/* registration labels (username/password) flip alignment */
html[dir="rtl"] .reg-card label { text-align: right; }

/* ---- PayPal modal ---- */
.btn-paypal {
  margin-top: .5em;
  padding: .4em 1.2em;
  font-size: .85rem;
  background: #ffc439;
  color: #111;
  border: none;
}
.btn-paypal:hover { background: #ffd771; }

.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #1e1e36;
  border-radius: 16px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
}
.modal-box h3 { margin-bottom: .5rem; }
.modal-box p { font-size: .9rem; color: #999; margin-bottom: 1.2rem; }
.modal-box label { display: block; text-align: left; margin-bottom: 1rem; }
.modal-box label span { font-size: .85rem; color: #aaa; }
.modal-box input {
  width: 100%;
  padding: .6em .8em;
  margin-top: .3em;
  border: 1px solid #444;
  border-radius: 8px;
  background: #2a2a44;
  color: #eee;
  font: inherit;
}
.modal-err { color: #ff6b6b; font-size: .85rem; margin-bottom: .8rem; min-height: 1.2em; }
.modal-box .btn { width: 100%; margin-bottom: .5rem; }

/* ---- dashboard ---- */
.dash-wrap { max-width: 800px; margin: 0 auto; padding: 2rem 1.5rem; }
.dash-head { text-align: center; margin-bottom: 2rem; }
.dash-head h1 { font-size: 1.8rem; margin-bottom: .3rem; }
.dash-head p { font-size: 1rem; color: #999; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.dash-card {
  background: #1a1a30;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid #2a2a44;
}
.dash-card h3 { font-size: .85rem; color: #888; margin-bottom: .5rem; text-transform: uppercase; letter-spacing: .05em; }
.dash-val { font-size: 1.3rem; font-weight: 700; color: #a29bfe; }
.dash-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

