:root {
  color-scheme: light;
  --ios-bg: #f2f4f8;
  --ios-card: rgba(255, 255, 255, 0.94);
  --ios-label: #111827;
  --ios-secondary: #6b7280;
  --ios-tertiary: #9ca3af;
  --ios-blue: #0a84ff;
  --ios-blue-dark: #006edb;
  --ios-green: #22c55e;
  --ios-red: #ff3b30;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Kantumruy Pro", Arial, sans-serif;
  background:
    radial-gradient(circle at 15% 0%, rgba(10, 132, 255, 0.08), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(34, 197, 94, 0.06), transparent 30%),
    var(--ios-bg);
  color: var(--ios-label);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.page-shell {
  width: 100%;
  margin: 0;
  padding: 0;
}

.register-screen {
  width: min(100%, 430px);
  height: 100dvh;
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 12px;
  position: relative;
  overflow: hidden;
}

.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), transparent 42%),
    radial-gradient(circle at 18% 0%, rgba(0, 122, 255, 0.14), transparent 34%),
    radial-gradient(circle at 94% 18%, rgba(52, 199, 89, 0.12), transparent 30%),
    var(--ios-bg);
}

.reg-card {
  width: 100%;
  padding: 18px 16px;
  max-height: calc(100dvh - 24px);
  border-radius: 8px;
  background: var(--ios-card);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 55px rgba(17, 24, 39, 0.13);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.reg-header {
  text-align: center;
  margin-bottom: 14px;
}

.reg-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--ios-blue), #5ac8fa);
  color: #ffffff;
  font-size: 19px;
  box-shadow: 0 12px 26px rgba(0, 122, 255, 0.28);
}

.reg-header h1 {
  margin: 0;
  color: var(--ios-label);
  font-size: 1.72rem;
  line-height: 1.06;
}

.reg-header p {
  margin: 5px 0 0;
  color: var(--ios-secondary);
  font-size: 13px;
  line-height: 1.35;
}

.register-form {
  display: grid;
  gap: 10px;
}

.register-form label,
.gender-group legend {
  display: grid;
  gap: 5px;
  color: var(--ios-label);
  font-size: 13px;
  font-weight: 700;
}

.input-field {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(118, 118, 128, 0.12);
  color: var(--ios-label);
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
  outline: none;
  font: inherit;
  font-size: 16px;
}

.input-field::placeholder {
  color: var(--ios-tertiary);
}

.input-field:focus {
  background: #ffffff;
  border-color: rgba(0, 122, 255, 0.4);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.13);
}

select.input-field {
  appearance: none;
  background-image:
    linear-gradient(45deg, var(--ios-secondary) 50%, transparent 50%),
    linear-gradient(135deg, var(--ios-secondary) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 20px,
    calc(100% - 15px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.gender-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.gender-group legend {
  margin-bottom: 6px;
}

.gender-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.gender-option {
  cursor: pointer;
}

.gender-tile {
  min-height: 72px;
  padding: 10px 6px;
  display: grid;
  place-items: center;
  gap: 5px;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(118, 118, 128, 0.12);
  color: var(--ios-secondary);
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, color 0.18s;
}

.gender-tile i {
  color: var(--ios-blue);
  font-size: 20px;
}

.gender-male strong,
.gender-female strong,
.gender-other strong {
  font-size: 12px;
}

.gender-option input:checked + .gender-male,
.gender-option input:checked + .gender-female,
.gender-option input:checked + .gender-other {
  border-color: rgba(0, 122, 255, 0.36);
  background: rgba(0, 122, 255, 0.11);
  color: var(--ios-label);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.btn-submit {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--ios-blue);
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.16s, transform 0.16s, box-shadow 0.16s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 14px 28px rgba(0, 122, 255, 0.24);
}

.btn-submit:hover {
  background: var(--ios-blue-dark);
  box-shadow: 0 18px 34px rgba(0, 122, 255, 0.3);
  transform: translateY(-1px);
}

.btn-submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

.hidden {
  display: none;
}

.register-footer {
  margin-top: 12px;
  text-align: center;
  color: var(--ios-secondary);
  font-size: 13px;
}

.register-footer p {
  margin: 0;
}

.register-footer a {
  color: var(--ios-blue);
  font-weight: 800;
  text-decoration: none;
}

.alert-box {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid rgba(255, 59, 48, 0.2);
  color: #b42318;
  font-size: 13px;
  line-height: 1.35;
}

.alert-box ul {
  margin: 0;
  padding-left: 18px;
}

.response-modal {
  border: none;
  padding: 0;
  background: transparent;
}

.response-modal::backdrop {
  background: rgba(17, 24, 39, 0.34);
  backdrop-filter: blur(8px);
}

.response-card {
  width: min(100vw - 32px, 360px);
  padding: 22px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.9);
  text-align: center;
  box-shadow: 0 25px 70px rgba(17, 24, 39, 0.18);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.response-card h3 {
  margin: 0 0 8px;
  color: var(--ios-label);
}

.response-card p {
  margin: 0;
  color: var(--ios-secondary);
  line-height: 1.5;
}

.modal-icon {
  display: block;
  margin: 0 auto 12px;
  color: var(--ios-green);
  font-size: 46px;
}

.modal-close {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  border: 0;
  border-radius: 8px;
  background: var(--ios-blue);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 380px) {
  .register-screen {
    padding: 10px;
  }

  .reg-card {
    padding: 16px 14px;
  }

  .reg-header h1 {
    font-size: 1.58rem;
  }

  .gender-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 700px) {
  .reg-logo {
    width: 42px;
    height: 42px;
    margin-bottom: 10px;
    font-size: 16px;
  }

  .reg-header {
    margin-bottom: 10px;
  }

  .reg-header p {
    margin-top: 4px;
    font-size: 12px;
  }

  .register-form {
    gap: 8px;
  }

  .gender-tile {
    min-height: 68px;
  }

  .register-footer {
    margin-top: 10px;
  }
}
