:root {
  --text: #6b6375;
  --text-h: #08060d;
  --bg: #ffffff;
  --border: #e5e4e7;
  --code-bg: #f4f3ec;
  --accent: #aa3bff;
  --accent-bg: rgba(170, 59, 255, .1);
  --accent-border: rgba(170, 59, 255, .5);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, .08);
  --danger-border: rgba(220, 38, 38, .45);
  --sans: 'Vazirmatn', 'Estedad', 'Harmattan', system-ui, 'Segoe UI', Tahoma, sans-serif;
  /* Card sits on a dark photo at 45% opacity in both themes, so its text
     stays fixed light regardless of light/dark mode. */
  --glass-text: #d9d6e0;
  --glass-text-h: #faf9fc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #9ca3af;
    --text-h: #f3f4f6;
    --bg: #16171d;
    --border: #2e303a;
    --code-bg: #1f2028;
    --accent: #c084fc;
    --accent-bg: rgba(192, 132, 252, .15);
    --accent-border: rgba(192, 132, 252, .5);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, .14);
    --danger-border: rgba(248, 113, 113, .45);
  }
}

* { box-sizing: border-box; }

html {
  font-size: 21px;
}
@media (max-width: 1024px) { html { font-size: 19px; } }
@media (max-width: 640px) { html { font-size: 17px; } }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--bg) url('/static/bg.jpg') center/cover no-repeat;
  color: var(--text);
  font-family: var(--sans);
  line-height: 170%;
  letter-spacing: 0;
}

.page {
  width: 100%;
  max-width: 30rem;
}

.header {
  display: flex;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.logo {
  height: 2.75rem;
  width: auto;
  background: #ffffff;
  padding: .6rem 1rem;
  border-radius: .6rem;
}

.card {
  position: relative;
  text-align: center;
  background: color-mix(in srgb, var(--code-bg) 40%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 1.25rem;
  padding: 2rem 1.75rem;
  backdrop-filter: blur(20px) saturate(160%) brightness(1.08);
  -webkit-backdrop-filter: blur(20px) saturate(160%) brightness(1.08);
  box-shadow:
    0 1.5rem 3rem rgba(8, 6, 13, .35),
    inset 1px 1px 0 rgba(255, 255, 255, .35),
    inset -1px -1px 0 rgba(255, 255, 255, .06),
    inset 0 0 20px rgba(255, 255, 255, .06);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card {
    background: var(--code-bg);
  }
}

/* Isolate direction only for lines where fa/en don't share a "/" separator
   (title, thank-you paragraphs) -- isolating label/button pairs breaks the
   " / " that joins them, so those are deliberately left out. */
.title .fa, .title .en,
.thank-you p.fa, .thank-you p.en {
  unicode-bidi: isolate;
}
.title .fa, .thank-you p.fa { direction: rtl; }
.title .en, .thank-you p.en { direction: ltr; }

.title {
  margin: 0 0 .35rem;
  font-size: 1.4rem;
  color: var(--glass-text-h);
}
.title .en {
  display: block;
  font-size: .65em;
  font-weight: 400;
  color: var(--glass-text);
  margin-top: .2rem;
}

.subtitle {
  margin: 0 0 1.5rem;
  font-size: .9rem;
  color: var(--glass-text);
}

.field {
  margin-bottom: 1.1rem;
}

label {
  display: block;
  margin-bottom: .4rem;
  font-size: .85rem;
  color: var(--glass-text-h);
}
label .en {
  color: var(--glass-text);
  font-weight: 400;
}
label .en::before {
  content: " / ";
}

input {
  width: 100%;
  text-align: center;
  padding: .7em .8em;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: #ffffff;
  color: #08060d;
  font-family: inherit;
  font-size: 1rem;
}
input:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  border-radius: .5rem;
  padding: .7em .9em;
  font-size: .85rem;
  margin: 0 0 1rem;
}

.btn-5 {
  position: relative;
  display: block;
  width: 100%;
  cursor: pointer;
  background: transparent;
  color: #000000;
  border: none;
  border-top-right-radius: .6rem;
  border-bottom-left-radius: .6rem;
  padding: .85em 1.5em;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  transition: border-radius .5s;
}
.btn-5::after,
.btn-5::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 0 solid transparent;
  transition: all .5s;
}
.btn-5::after {
  top: -2px;
  left: -2px;
  border-top: 2px solid #000000;
  border-left: 2px solid #000000;
}
.btn-5::before {
  bottom: -2px;
  right: -2px;
  border-bottom: 2px solid #000000;
  border-right: 2px solid #000000;
}
.btn-5:hover,
.btn-5:focus-visible {
  border-top-right-radius: 0;
  border-bottom-left-radius: 0;
}
.btn-5:hover::after,
.btn-5:hover::before,
.btn-5:focus-visible::after,
.btn-5:focus-visible::before {
  width: 100%;
  height: 100%;
}
.btn-5:disabled {
  opacity: .6;
  cursor: default;
}

.thank-you {
  text-align: center;
}
.check {
  width: 3.5rem;
  height: 3.5rem;
  line-height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 1.6rem;
}
.thank-you p {
  margin: .25rem 0;
  color: var(--glass-text-h);
}
.thank-you .en {
  color: var(--glass-text);
  font-size: .9rem;
}
.thank-you .note {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--glass-text) 25%, transparent);
  font-size: .85rem;
}
