:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5fb;
  --bg-elev: #ffffff;
  --text: #1b2133;
  --muted: #5d6780;
  --line: rgba(27, 33, 51, 0.1);
  --primary: #3c54ff;
  --primary-strong: #2436c9;
  --primary-soft: rgba(60, 84, 255, 0.12);
  --glow: rgba(60, 84, 255, 0.16);
  --danger: #e11d48;
  --shadow: 0 18px 50px rgba(28, 36, 72, 0.08);
  --input: #f8f9fd;
  --link: #2436c9;
  --ok-bg: #e7f8ef;
  --ok-text: #0f6b3c;
  --err-bg: #fdecef;
  --err-text: #9f1239;
  --banner-bg: #fff6e8;
  --banner-text: #8a4b08;
  --banner-line: #f0d7a8;
  --glass-fill: color-mix(in srgb, #fff 24%, transparent);
  --glass-sheen: rgba(255, 255, 255, 0.72);
  --glass-rim: rgba(0, 0, 0, 0.16);
  --glass-shadow: 0 18px 46px rgba(28, 36, 60, 0.1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07080d;
  --bg-elev: #151a2b;
  --text: #eef1f8;
  --muted: #a7b0c6;
  --line: rgba(255, 255, 255, 0.1);
  --primary: #7c91ff;
  --primary-strong: #c5ceff;
  --primary-soft: rgba(124, 145, 255, 0.16);
  --glow: rgba(60, 84, 255, 0.28);
  --danger: #fb7185;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --input: #101524;
  --link: #b7c4ff;
  --ok-bg: #123226;
  --ok-text: #b6f3d2;
  --err-bg: #3d1520;
  --err-text: #fecdd6;
  --banner-bg: #3a2a12;
  --banner-text: #ffd89a;
  --banner-line: #6a4e22;
  --glass-fill: color-mix(in srgb, #1c1c1e 18%, transparent);
  --glass-sheen: rgba(255, 255, 255, 0.34);
  --glass-rim: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 22px 50px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  background:
    radial-gradient(540px 340px at 6% -8%, rgba(90, 200, 250, 0.42), transparent 62%),
    radial-gradient(460px 320px at 100% 0%, rgba(175, 82, 222, 0.28), transparent 58%),
    radial-gradient(620px 380px at 88% 108%, rgba(52, 199, 89, 0.16), transparent 60%),
    radial-gradient(480px 280px at 0% 86%, rgba(10, 132, 255, 0.16), transparent 58%),
    var(--bg);
  color: var(--text);
  line-height: 1.9;
  font-size: 1.02rem;
}

html[lang="en"] body { line-height: 1.7; }

html[data-theme="dark"] body {
  background:
    radial-gradient(540px 340px at 6% -8%, rgba(10, 132, 255, 0.38), transparent 62%),
    radial-gradient(460px 320px at 100% 0%, rgba(191, 90, 242, 0.3), transparent 58%),
    radial-gradient(620px 380px at 88% 108%, rgba(48, 209, 88, 0.14), transparent 60%),
    var(--bg);
}

img,
video,
canvas,
iframe {
  max-width: 100%;
  height: auto;
}

button, input, textarea { font: inherit; color: inherit; }

a { color: var(--link); }

h1, h2, h3 { line-height: 1.35; }

html[lang="en"] h1 { letter-spacing: -0.03em; }

p { margin: 0; }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

::selection { background: rgba(60, 84, 255, 0.22); }

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.prose { white-space: pre-line; }

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.15rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, #fff 26%, var(--primary)), var(--primary));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 8px 18px rgba(60, 84, 255, 0.28);
}
.btn-primary:hover { background: var(--primary-strong); color: #fff; }
.btn-ghost {
  color: var(--text);
  background: color-mix(in srgb, #fff 38%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(16px) saturate(1.6);
}
.btn-ghost:hover { background: color-mix(in srgb, #fff 62%, transparent); }
html[data-theme="dark"] .btn-ghost {
  background: color-mix(in srgb, #fff 10%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 0 0.5px rgba(255, 255, 255, 0.12);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }

.field { display: grid; gap: 0.4rem; margin-bottom: 0.9rem; }
.field span { font-weight: 800; font-size: 0.92rem; }

.hint { color: var(--muted); font-size: 0.82rem; }

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
  width: 100%;
  background: color-mix(in srgb, #fff 42%, transparent);
  border: 0;
  border-radius: 16px;
  padding: 0.75rem 0.9rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 0 0 0.5px var(--glass-rim);
  backdrop-filter: blur(16px) saturate(1.5);
}
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="file"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: color-mix(in srgb, #fff 8%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 0 0 0.5px rgba(255, 255, 255, 0.14);
}

textarea { resize: vertical; min-height: 120px; }

input[type="checkbox"] { width: auto; accent-color: var(--primary); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: end;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.field-check { min-height: 48px; margin-bottom: 0.9rem; }

.flashes, .banner {
  width: min(1120px, calc(100% - 2rem));
  margin: 1rem auto 0;
}

.flashes { display: grid; gap: 0.5rem; }

.flash, .banner {
  border-radius: 12px;
  padding: 0.8rem 1rem;
}

.flash-success { background: var(--ok-bg); color: var(--ok-text); }
.flash-error { background: var(--err-bg); color: var(--err-text); }
.banner {
  background: var(--banner-bg);
  color: var(--banner-text);
  border: 1px solid var(--banner-line);
}

.hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

@media (max-width: 700px) {
  .form-row { grid-template-columns: 1fr; }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
