* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.language-switcher {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
}

.language-switcher select {
  --flag-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12'%3E%3Crect width='18' height='12' fill='%23b22234'/%3E%3Cg fill='%23ffffff'%3E%3Crect y='2' width='18' height='2'/%3E%3Crect y='6' width='18' height='2'/%3E%3Crect y='10' width='18' height='2'/%3E%3C/g%3E%3Crect width='7' height='6' fill='%232e3a87'/%3E%3Ccircle cx='1.6' cy='1.4' r='0.6' fill='%23ffffff'/%3E%3Ccircle cx='3.4' cy='1.4' r='0.6' fill='%23ffffff'/%3E%3Ccircle cx='5.2' cy='1.4' r='0.6' fill='%23ffffff'/%3E%3Ccircle cx='1.6' cy='3.2' r='0.6' fill='%23ffffff'/%3E%3Ccircle cx='3.4' cy='3.2' r='0.6' fill='%23ffffff'/%3E%3Ccircle cx='5.2' cy='3.2' r='0.6' fill='%23ffffff'/%3E%3Ccircle cx='1.6' cy='5.0' r='0.6' fill='%23ffffff'/%3E%3Ccircle cx='3.4' cy='5.0' r='0.6' fill='%23ffffff'/%3E%3Ccircle cx='5.2' cy='5.0' r='0.6' fill='%23ffffff'/%3E%3C/svg%3E");
  appearance: none;
  border: 1px solid rgba(15, 20, 27, 0.2);
  border-radius: 999px;
  padding: 6px 30px 6px 36px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #fff;
  color: #0f141b;
  box-shadow: 0 6px 14px rgba(15, 20, 27, 0.12);
  background-image: var(--flag-icon),
    linear-gradient(45deg, transparent 50%, #0f141b 50%),
    linear-gradient(135deg, #0f141b 50%, transparent 50%);
  background-position: 10px center, calc(100% - 14px) calc(50% - 2px), calc(100% - 10px) calc(50% - 2px);
  background-size: 16px 11px, 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.language-switcher select:focus {
  outline: none;
  border-color: #0b4f6c;
  box-shadow: 0 0 0 3px rgba(11, 79, 108, 0.2);
}

.language-switcher select[data-lang="en"] {
  --flag-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12'%3E%3Crect width='18' height='12' fill='%23b22234'/%3E%3Cg fill='%23ffffff'%3E%3Crect y='2' width='18' height='2'/%3E%3Crect y='6' width='18' height='2'/%3E%3Crect y='10' width='18' height='2'/%3E%3C/g%3E%3Crect width='7' height='6' fill='%232e3a87'/%3E%3Ccircle cx='1.6' cy='1.4' r='0.6' fill='%23ffffff'/%3E%3Ccircle cx='3.4' cy='1.4' r='0.6' fill='%23ffffff'/%3E%3Ccircle cx='5.2' cy='1.4' r='0.6' fill='%23ffffff'/%3E%3Ccircle cx='1.6' cy='3.2' r='0.6' fill='%23ffffff'/%3E%3Ccircle cx='3.4' cy='3.2' r='0.6' fill='%23ffffff'/%3E%3Ccircle cx='5.2' cy='3.2' r='0.6' fill='%23ffffff'/%3E%3Ccircle cx='1.6' cy='5.0' r='0.6' fill='%23ffffff'/%3E%3Ccircle cx='3.4' cy='5.0' r='0.6' fill='%23ffffff'/%3E%3Ccircle cx='5.2' cy='5.0' r='0.6' fill='%23ffffff'/%3E%3C/svg%3E");
}

.language-switcher select[data-lang="es"] {
  --flag-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12'%3E%3Crect width='18' height='12' fill='%23aa151b'/%3E%3Crect y='3' width='18' height='6' fill='%23f1bf00'/%3E%3C/svg%3E");
}

.language-switcher select[data-lang="sv"] {
  --flag-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12'%3E%3Crect width='18' height='12' fill='%23006aa7'/%3E%3Crect x='5' width='3' height='12' fill='%23fecc00'/%3E%3Crect y='4.5' width='18' height='3' fill='%23fecc00'/%3E%3C/svg%3E");
}

.language-switcher select[data-lang="he"] {
  --flag-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12'%3E%3Crect width='18' height='12' fill='%23ffffff'/%3E%3Crect y='1' width='18' height='2' fill='%23003399'/%3E%3Crect y='9' width='18' height='2' fill='%23003399'/%3E%3Cpolygon points='9,3.2 10.1,5.1 12.3,5.1 10.5,6.4 11.2,8.3 9,7.1 6.8,8.3 7.5,6.4 5.7,5.1 7.9,5.1' fill='%23003399'/%3E%3Cpolygon points='9,8.8 7.9,6.9 5.7,6.9 7.5,5.6 6.8,3.7 9,4.9 11.2,3.7 10.5,5.6 12.3,6.9 10.1,6.9' fill='%23003399'/%3E%3C/svg%3E");
}

.language-switcher select[data-lang="ru"] {
  --flag-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12'%3E%3Crect width='18' height='12' fill='%23ffffff'/%3E%3Crect y='4' width='18' height='4' fill='%23003f9e'/%3E%3Crect y='8' width='18' height='4' fill='%23d52b1e'/%3E%3C/svg%3E");
}

body.page-signup {
  color-scheme: light;
  --ink: #0f141b;
  --muted: #4c5563;
  --accent: #0b4f6c;
  --accent-2: #ff6b35;
  --card: #f8f4f0;
  --shadow: 0 22px 60px rgba(15, 20, 27, 0.18);
  --radius: 24px;
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 15% 20%, #fef1e6 0%, #fde9d6 35%, #f3efe9 65%, #e9f1f4 100%);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

body.page-signup .page {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 28px;
  align-items: stretch;
}

body.page-signup .hero {
  padding: 40px;
  border-radius: var(--radius);
  background: linear-gradient(140deg, #0b4f6c 0%, #124559 45%, #1b2a41 100%);
  color: #f5f7fb;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

body.page-signup .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255, 107, 53, 0.35), transparent 55%);
}

body.page-signup .hero h1 {
  position: relative;
  margin: 0 0 12px;
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.02em;
}

body.page-signup .hero p {
  position: relative;
  margin: 0;
  color: rgba(245, 247, 251, 0.85);
  line-height: 1.5;
}

body.page-signup .card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 20px;
  animation: rise 0.6s ease-out both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.page-signup .fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

body.page-signup .field {
  display: grid;
  gap: 6px;
}

body.page-signup label {
  font-size: 0.9rem;
  font-weight: 600;
}

body.page-signup input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 20, 27, 0.15);
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.page-signup input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 79, 108, 0.2);
}

body.page-signup .full {
  grid-column: 1 / -1;
}

body.page-signup button {
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(120deg, var(--accent) 0%, #106581 55%, var(--accent-2) 100%);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.page-signup button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(11, 79, 108, 0.3);
}

body.page-signup button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

body.page-signup .note {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

body.page-signup .field-hint {
  margin: 6px 0 0;
  padding-left: 18px;
  color: rgba(76, 85, 99, 0.65);
  font-size: 0.8rem;
  font-style: italic;
}

body.page-signup .field-hint li {
  margin: 2px 0;
}

body.page-signup .field-error {
  min-height: 1rem;
  font-size: 0.8rem;
  color: #b42318;
}

body.page-signup .helper {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

body.page-signup .helper a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

body.page-signup .helper a:hover {
  text-decoration: underline;
}

@media (max-width: 840px) {
  body.page-signup .page {
    grid-template-columns: 1fr;
  }
  body.page-signup .fields {
    grid-template-columns: 1fr;
  }
}

body.page-index {
  color-scheme: light;
  --ink: #0f141b;
  --muted: #4c5563;
  --accent: #0b4f6c;
  --accent-2: #ff6b35;
  --card: #f8f4f0;
  --shadow: 0 22px 60px rgba(15, 20, 27, 0.18);
  --radius: 22px;
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 12% 20%, #f7f0e6 0%, #f3efe9 45%, #e7eef2 100%);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

body.page-index .card {
  width: min(720px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
  display: grid;
  gap: 18px;
  text-align: center;
  animation: rise 0.55s ease-out both;
}

body.page-index h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
}

body.page-index p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

body.page-index .actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

body.page-index a {
  text-decoration: none;
  color: #fff;
  background: linear-gradient(120deg, var(--accent) 0%, #106581 55%, var(--accent-2) 100%);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.page-index a:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(11, 79, 108, 0.3);
}

body.page-login {
  color-scheme: light;
  --ink: #0f141b;
  --muted: #4c5563;
  --accent: #0b4f6c;
  --accent-2: #ff6b35;
  --card: #f8f4f0;
  --shadow: 0 22px 60px rgba(15, 20, 27, 0.18);
  --radius: 22px;
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 78% 12%, #fef1e6 0%, #f3efe9 50%, #e7eef2 100%);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

body.page-login .card {
  width: min(520px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
  display: grid;
  gap: 18px;
  text-align: center;
  animation: rise 0.55s ease-out both;
}

body.page-login h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
}

body.page-login p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

body.page-login form {
  display: grid;
  gap: 14px;
  text-align: left;
}

body.page-login .field {
  display: grid;
  gap: 6px;
}

body.page-login label {
  font-size: 0.9rem;
  font-weight: 600;
}

body.page-login input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 20, 27, 0.15);
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.page-login input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 79, 108, 0.2);
}

body.page-login button {
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(120deg, var(--accent) 0%, #106581 55%, var(--accent-2) 100%);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.page-login button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(11, 79, 108, 0.3);
}

body.page-login .helper a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

body.page-login .helper a:hover {
  text-decoration: underline;
}
