:root {
  color-scheme: light;
  --ios-bg: #f8fafc;
  --ios-card: #ffffff;
  --ios-label: #0f172a;
  --ios-secondary: #64748b;
  --ios-tertiary: #94a3b8;
  --ios-line: rgba(226, 232, 240, 0.85);
  --ios-blue: #2caee0;
  --ios-blue-dark: #1b9bd0;
  --ios-green: #10b981;
  --ios-red: #ef4444;
}

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(44, 174, 224, 0.08), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(16, 185, 129, 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(44, 174, 224, 0.1), transparent 34%),
    radial-gradient(circle at 94% 18%, rgba(16, 185, 129, 0.08), transparent 30%),
    var(--ios-bg);
}

.reg-card {
  width: 100%;
  padding: 20px 16px;
  max-height: calc(100dvh - 24px);
  border-radius: 12px;
  background: var(--ios-card);
  border: 1px solid var(--ios-line);
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08);
  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: 10px;
  background: linear-gradient(135deg, var(--ios-blue), var(--ios-blue-dark));
  color: #ffffff;
  font-size: 19px;
  box-shadow: 0 4px 14px rgba(44, 174, 224, 0.35);
}

.reg-header h1 {
  margin: 0;
  color: var(--ios-label);
  font-size: 1.72rem;
  line-height: 1.06;
  font-weight: 800;
}

.reg-header p {
  margin: 5px 0 0;
  color: var(--ios-secondary);
  font-size: 13px;
  line-height: 1.35;
}

.register-form {
  display: grid;
  gap: 10px;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.password-row .icon-button {
  min-height: 46px;
  width: 46px;
  padding: 0;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--ios-secondary);
  cursor: pointer;
  transition: background 0.16s;
}

.password-row .icon-button:hover {
  background: #e2e8f0;
}

.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 #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ios-label);
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
  outline: none;
  font: inherit;
  font-size: 16px;
  box-sizing: border-box;
}

.input-field::placeholder {
  color: var(--ios-tertiary);
}

.input-field:focus {
  background: #ffffff;
  border-color: var(--ios-blue);
  box-shadow: 0 0 0 3px rgba(44, 174, 224, 0.18);
}

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;
}

select.input-field option {
  background: #ffffff;
  color: #111827;
}

.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 var(--ios-line);
  border-radius: 10px;
  background: #f8fafc;
  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-secondary);
  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: var(--ios-blue);
  background: var(--ios-blue);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(44, 174, 224, 0.35);
}

.gender-option input:checked + .gender-male i,
.gender-option input:checked + .gender-female i,
.gender-option input:checked + .gender-other i {
  color: #ffffff;
}

.btn-submit {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ios-blue), var(--ios-blue-dark));
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: filter 0.16s, transform 0.16s, box-shadow 0.16s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(44, 174, 224, 0.35);
}

.btn-submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 28px rgba(44, 174, 224, 0.42);
  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: underline;
}

.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;
  }
}
