:root {
  color-scheme: light;
  --paper: #ffffff;
  --surface: rgba(255, 255, 255, 0.92);
  --soft: #f4f7f6;
  --ink: #17202a;
  --muted: #5d6875;
  --line: #dfe5ea;
  --green: #1c6b5a;
  --green-strong: #155344;
  --teal: #38a3a5;
  --gold: #c28a31;
  --navy: #1f3446;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(23, 32, 42, 0.11);
  --radius-lg: 8px;
  --radius-md: 6px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.88) 48%, rgba(31, 52, 70, 0.16) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='1000' viewBox='0 0 1600 1000'%3E%3Crect width='1600' height='1000' fill='%23edf3f1'/%3E%3Cg opacity='0.7'%3E%3Cpath d='M0 745 L395 590 L740 710 L1180 480 L1600 585 L1600 1000 L0 1000 Z' fill='%23d9e7e3'/%3E%3Cpath d='M0 310 L320 420 L690 265 L1045 360 L1600 205 L1600 0 L0 0 Z' fill='%23f8faf8'/%3E%3Cpath d='M118 678 L366 574 L606 653 L821 536 L1066 580 L1325 440' fill='none' stroke='%2338a3a5' stroke-width='9' stroke-linecap='round'/%3E%3Cpath d='M194 344 L412 415 L631 319 L858 377 L1126 298 L1390 226' fill='none' stroke='%23c28a31' stroke-width='7' stroke-linecap='round' opacity='0.9'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  letter-spacing: 0;
}

html[dir="ltr"] body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

button,
input,
a {
  font: inherit;
}

button,
a,
input,
label {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  display: grid;
  min-height: calc(100vh - 70px);
  place-items: center;
  padding: 28px 20px 18px;
}

.landing-card {
  display: grid;
  width: min(100%, 1040px);
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1fr);
  overflow: hidden;
  border: 1px solid rgba(31, 52, 70, 0.12);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.visual-panel {
  position: relative;
  display: grid;
  min-height: 650px;
  place-items: center;
  padding: 38px;
  background:
    linear-gradient(145deg, rgba(31, 52, 70, 0.98), rgba(28, 107, 90, 0.94)),
    var(--navy);
}

.visual-panel::before {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: var(--radius-lg);
  pointer-events: none;
}

.visual-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 20%, rgba(255, 255, 255, 0.08) 20% 20.4%, transparent 20.4% 42%, rgba(194, 138, 49, 0.18) 42% 42.4%, transparent 42.4%),
    linear-gradient(40deg, rgba(56, 163, 165, 0.12), transparent 48%);
  pointer-events: none;
}

.wallet-card-preview {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 360px);
  aspect-ratio: 1.58;
  flex-direction: column;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-lg);
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.06)),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.14));
  box-shadow: 0 28px 58px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
}

.wallet-card-top,
.wallet-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
  font-weight: 800;
}

.wallet-chip {
  width: 42px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(194, 138, 49, 0.92), rgba(255, 255, 255, 0.22));
}

.wallet-card-title {
  margin-top: auto;
  color: #ffffff;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.1;
}

.stamp-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.stamp-row span {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--gold);
  font-size: 1rem;
  font-weight: 900;
}

.stamp-row span:nth-child(-n + 3) {
  background: #ffffff;
}

.form-panel {
  padding: 34px;
}

.topbar,
.not-found-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

html[dir="ltr"] .eyebrow {
  letter-spacing: 0.08em;
}

h1,
h2,
p,
legend {
  margin: 0;
}

h1 {
  color: var(--navy);
  font-size: clamp(2.25rem, 5vw, 3.35rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0;
}

.lead {
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.lang-toggle {
  flex: 0 0 auto;
  min-width: 54px;
  min-height: 42px;
  border: 1px solid rgba(31, 52, 70, 0.14);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--navy);
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.07);
}

.lang-toggle:hover {
  border-color: rgba(28, 107, 90, 0.3);
}

.intro {
  margin: 24px 0 26px;
}

.progress {
  height: 8px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(28, 107, 90, 0.11);
}

.progress-bar {
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--green), var(--teal));
  transition: width 180ms ease;
}

.registration-form {
  display: grid;
  gap: 17px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
legend {
  color: #233343;
  font-weight: 900;
}

input[type="text"],
input[type="tel"] {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--ink);
  padding: 12px 14px;
}

input[type="tel"] {
  direction: ltr;
  text-align: left;
}

input:focus {
  border-color: rgba(28, 107, 90, 0.5);
  outline: 3px solid rgba(28, 107, 90, 0.13);
}

.phone-input {
  display: grid;
  min-height: 50px;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  direction: ltr;
  padding-inline: 14px;
}

.phone-input:focus-within {
  border-color: rgba(28, 107, 90, 0.5);
  outline: 3px solid rgba(28, 107, 90, 0.13);
}

.phone-input input {
  min-height: auto;
  border: 0;
  background: transparent;
  padding-inline: 0;
}

.phone-input input:focus {
  outline: 0;
}

.prefix,
.flag,
.helper {
  color: var(--muted);
}

.helper {
  font-size: 0.82rem;
}

.gender-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border: 0;
  padding: 0;
}

.gender-group legend {
  width: 100%;
}

.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
  padding: 8px 14px;
}

.radio-pill:has(input:checked) {
  border-color: rgba(28, 107, 90, 0.44);
  background: rgba(28, 107, 90, 0.08);
  color: var(--green-strong);
}

.radio-pill input {
  accent-color: var(--green);
}

.submit-button,
.wallet-button,
.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--green);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  padding: 14px 18px;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(28, 107, 90, 0.2);
}

.submit-button:hover,
.wallet-button:hover,
.home-link:hover {
  background: var(--green-strong);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.wallet-actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.wallet-button.secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  box-shadow: none;
}

.result-panel {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.result-panel h2 {
  color: var(--navy);
}

.result-panel p {
  margin-top: 8px;
  color: var(--muted);
}

.member-number {
  display: grid;
  gap: 4px;
  justify-items: center;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  color: var(--muted);
}

.member-number.hidden {
  display: none;
}

.member-number strong {
  color: var(--navy);
  font-size: 2rem;
  letter-spacing: 0.12em;
}

.error {
  min-height: 1rem;
  color: var(--danger);
}

.hidden {
  display: none;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 8px 18px 22px;
}

.site-footer a {
  color: var(--green-strong);
  font-weight: 900;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.not-found-shell {
  display: grid;
  min-height: calc(100vh - 76px);
  place-items: center;
  padding: 28px 18px 18px;
}

.not-found-card {
  width: min(100%, 720px);
  border: 1px solid rgba(31, 52, 70, 0.12);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 34px;
  backdrop-filter: blur(16px);
}

.not-found-topbar {
  margin-bottom: 18px;
}

.not-found-card .eyebrow {
  margin: 0;
}

.not-found-card h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
}

.not-found-card p {
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.not-found-card .home-link {
  margin-top: 26px;
}

html[dir="ltr"] .not-found-card {
  text-align: left;
}

@media (max-width: 820px) {
  .page-shell {
    display: block;
    min-height: auto;
    padding: 14px;
  }

  .landing-card {
    grid-template-columns: 1fr;
  }

  .visual-panel {
    min-height: 275px;
    padding: 28px;
  }

  .visual-panel::before {
    inset: 16px;
  }

  .wallet-card-preview {
    width: min(100%, 330px);
  }

  .form-panel {
    padding: 24px;
  }
}

@media (max-width: 520px) {
  .topbar,
  .not-found-topbar {
    gap: 12px;
  }

  .form-panel,
  .not-found-card {
    padding: 22px;
  }

  .wallet-card-title {
    font-size: 1.65rem;
  }

  .stamp-row {
    gap: 6px;
  }
}

.turnstile-slot:not(.hidden) {
  display: flex;
  justify-content: center;
}
