*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f4f7f9;
  --white: #ffffff;
  --primary: #2b59c3;
  --primary-dark: #1e40af;
  --primary-light: #eff6ff;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --placeholder: #94a3b8;
  --border: #e2e8f0;
  --required: #ef4444;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  --radius-card: 16px;
  --radius-input: 10px;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.5;
}

.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.header {
  text-align: center;
  margin-bottom: 24px;
}

.header h1 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.header p {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.card {
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 28px 24px 24px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 22px;
}

.section-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.field {
  margin-bottom: 16px;
}

.field-nested {
  margin-top: 12px;
  margin-bottom: 0;
}

.field-nested[hidden] {
  display: none;
}

.field > label,
.field > .label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.required {
  color: var(--required);
}

.input-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--white);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 89, 195, 0.12);
}

.input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  flex-shrink: 0;
  background: var(--primary-light);
  margin: 6px 0 6px 6px;
  border-radius: 8px;
  color: var(--primary);
}

.input-icon svg {
  width: 20px;
  height: 20px;
}

.textarea-wrap .input-icon {
  align-self: flex-start;
  margin-top: 8px;
  height: 36px;
}

.input-wrap input,
.input-wrap textarea {
  flex: 1;
  border: none;
  outline: none;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text-dark);
  padding: 12px 14px;
  background: transparent;
  min-width: 0;
}

.input-wrap input::placeholder,
.input-wrap textarea::placeholder {
  color: var(--placeholder);
}

.input-wrap textarea {
  resize: vertical;
  min-height: 88px;
  padding-top: 14px;
}

.input-wrap input[type="date"] {
  color-scheme: light;
}

.input-wrap input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
}

.gender-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gender-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.gender-label:hover {
  border-color: #bfdbfe;
}

.gender-label input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.gender-label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

.checkboxes {
  margin: 20px 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-dark);
  cursor: pointer;
  line-height: 1.45;
}

.checkbox-row input {
  position: absolute;
  opacity: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.form-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.88rem;
  line-height: 1.45;
}

.text-link {
  color: var(--primary);
  font-weight: 500;
}

.submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  min-height: 52px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, transform 0.1s;
}

.submit-btn:disabled {
  opacity: 0.75;
  cursor: wait;
}

.submit-btn svg {
  width: 18px;
  height: 18px;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.checkbox-row input:checked ~ .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-row input:checked ~ .checkmark::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.submit-btn:hover {
  background: var(--primary-dark);
}

.submit-btn:active {
  transform: scale(0.99);
}

.otp-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: -8px 0 20px;
  line-height: 1.5;
}

.field-error {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--required);
}

.resend-row {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 8px 0 20px;
}

.link-btn {
  border: none;
  background: none;
  color: var(--primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.link-btn:disabled {
  color: var(--placeholder);
  cursor: not-allowed;
}

.link-btn:not(:disabled):hover {
  text-decoration: underline;
}

.back-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--primary);
}

.fb-guide-card {
  text-align: center;
}

.fb-icon-wrap {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: #1877f2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(24, 119, 242, 0.28);
}

.fb-icon {
  width: 36px;
  height: 36px;
  color: #ffffff;
}

.fb-guide-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 12px;
}

.fb-guide-text {
  font-size: 0.92rem;
  color: var(--text-dark);
  line-height: 1.6;
  margin-bottom: 18px;
}

.fb-name-box {
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.fb-name-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.fb-name-value {
  font-size: 1rem;
  color: var(--primary-dark);
  word-break: break-word;
}

.fb-guide-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 22px;
  text-align: left;
}

.fb-contact-btn {
  text-decoration: none;
}

.fail-result {
  text-align: center;
  padding: 8px 0 4px;
}

.fail-icon-wrap {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #fef2f2;
  border: 2px solid #fecaca;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fail-icon {
  width: 38px;
  height: 38px;
  color: #ef4444;
}

.fail-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #b91c1c;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.fail-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.fail-back-btn {
  text-decoration: none;
  background: #ef4444;
}

.fail-back-btn:hover {
  background: #dc2626;
}

@media (max-width: 400px) {
  .header h1 {
    font-size: 1.3rem;
  }
}
