
@font-face {
  font-family: "Vazirmatn";
  src: url("https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn[wght].woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
* { font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; -webkit-tap-highlight-color: rgba(255,255,255,0.05); }
html, body { height: 100%; }
body { position: relative; overflow-x: hidden; background: #0b1020; color: #e2e8f0; }

/* === Robust Background System === */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 800px at 85% -10%, rgba(99,102,241,0.25), transparent 60%),
    radial-gradient(900px 600px at 15% 10%, rgba(34,211,238,0.20), transparent 65%),
    radial-gradient(700px 500px at 50% 110%, rgba(168,85,247,0.18), transparent 60%),
    linear-gradient(180deg, rgba(2,6,23,1) 0%, rgba(2,6,23,0.92) 30%, rgba(2,6,23,0.96) 100%);
  filter: saturate(110%);
}

/* Cards / Inputs / Buttons */
:root { --glass-bg-dark: rgba(255,255,255,0.05); --glass-border-dark: rgba(255,255,255,0.12);
        --glass-bg-light: rgba(0,0,0,0.03);  --glass-border-light: rgba(2,6,23,0.08); }
.card { background: var(--glass-bg-dark); border: 1px solid var(--glass-border-dark); border-radius: 1rem; box-shadow: 0 10px 40px rgba(0,0,0,0.35); }
.card-header { padding: 1rem 1.25rem; border-bottom: 1px dashed rgba(255,255,255,0.12); background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0)); border-top-right-radius: 1rem; border-top-left-radius: 1rem; }
.card-title { font-weight: 900; font-size: 1.1rem; } .card-subtitle { opacity: .75; font-size: .9rem; margin-top: .25rem; } .card-body { padding: 1rem 1.25rem; }
.section-title { font-weight: 900; font-size: 1.4rem; background: linear-gradient(90deg, #fff, #93c5fd, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-fill-color: transparent; }
.input { width: 100%; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); border-radius: .75rem; padding: .7rem .9rem; outline: none; transition: border .2s, box-shadow .2s; color: #e2e8f0; }
.input:focus { border-color: rgba(255,255,255,0.35); box-shadow: 0 0 0 6px rgba(255,255,255,0.06); }
.btn { background: linear-gradient(135deg, #22d3ee, #818cf8); color: #0b1020; font-weight: 800; border-radius: .9rem; padding: .7rem 1rem; box-shadow: 0 10px 24px rgba(99,102,241,.35); transition: transform .15s ease, filter .2s ease; }
.btn-secondary { background: linear-gradient(135deg, #34d399, #a78bfa); color: #0b1020; font-weight: 800; border-radius: .9rem; padding: .7rem 1rem; box-shadow: 0 10px 24px rgba(167,139,250,.35); transition: transform .15s ease, filter .2s ease; }
.glass { background: var(--glass-bg-dark); border: 1px solid var(--glass-border-dark); box-shadow: 0 10px 40px rgba(0,0,0,0.35); }
.toast { position: fixed; bottom: 24px; right: 24px; background: linear-gradient(135deg, #22d3ee, #a78bfa); color: #0b1020; font-weight: 800; border-radius: 12px; padding: 12px 16px; box-shadow: 0 12px 30px rgba(0,0,0,0.35); transform: translateY(10px); opacity: 0; transition: all .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

/* Ring progress */
.ring-wrap { position: relative; width: 96px; height: 96px; }
.ring { --p: 0%; width: 100%; height: 100%; border-radius: 999px; background: conic-gradient(#22d3ee var(--p), rgba(255,255,255,0.08) var(--p)); display: grid; place-items: center; }
.ring-center { position: absolute; inset: 10px; border-radius: 999px; background: rgba(255,255,255,0.06); display: grid; place-items: center; border: 1px solid rgba(255,255,255,0.1); }

/* Select options readable */
select option { background: #0f172a; color: #f1f5f9; padding: 0.5rem 0.75rem; font-weight: 500; }
select option:hover, select option:focus, select option:checked { background: #1e293b; color: #ffffff; }

/* RTL date input */
input[type="date"] { direction: rtl; text-align: right; color-scheme: dark; }

/* Controls row */
.controls-row { display: flex; gap: .5rem; align-items: flex-end; }
@media (max-width: 640px) {
  .controls-row { display: grid; grid-template-columns: 1fr; }
  .controls-row .btn, .controls-row .btn-secondary { width: 100%; }
}

/* Theme switch */
.theme-switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.theme-switch .slider { position: absolute; cursor: pointer; inset: 0; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25); border-radius: 999px; transition: background .2s, border-color .2s; }
.theme-switch .slider:before { content: "☾"; position: absolute; height: 22px; width: 22px; left: 2px; top: 1px; display: grid; place-items: center; font-size: 12px; background: #fff; color: #0b1020; border-radius: 50%; transition: transform .2s, content .2s; box-shadow: 0 3px 10px rgba(0,0,0,0.25); }
.theme-switch input:checked + .slider { background: rgba(0,0,0,0.15); border-color: rgba(0,0,0,0.3); }
.theme-switch input:checked + .slider:before { transform: translateX(22px); content: "☀"; }

/* Light theme overrides */
html[data-theme="light"] body { color: #0f172a; }
html[data-theme="light"] body::before {
  background:
    radial-gradient(1100px 700px at 85% -10%, rgba(125,211,252,0.35), transparent 60%),
    radial-gradient(800px 500px at 20% 0%, rgba(196,181,253,0.28), transparent 65%),
    radial-gradient(700px 500px at 50% 110%, rgba(244,114,182,0.22), transparent 60%),
    linear-gradient(180deg, #f8fafc 0%, #f8fafc 40%, #eef2f7 100%);
}
html[data-theme="light"] .card, html[data-theme="light"] .glass { background: var(--glass-bg-light); border-color: var(--glass-border-light); }
html[data-theme="light"] .input { background: rgba(0,0,0,0.035); border-color: rgba(2,6,23,0.12); color: #0f172a; }
html[data-theme="light"] select option { background: #ffffff; color: #0f172a; }
