:root {
  --bg-1: #f4f7ff;
  --bg-2: #e8eeff;
  --card-bg: #ffffff;
  --text: #1e2640;
  --muted: #5e6a89;
  --primary: #3358ff;
  --primary-hover: #2446e8;
  --danger: #d43232;
  --success: #117d3c;
  --border: #d9e1ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(145deg, var(--bg-1), var(--bg-2));
  color: var(--text);
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(680px, 100%);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(20, 43, 118, 0.12);
  padding: 28px;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 2.8vw, 1.85rem);
}

.subtitle {
  margin: 0 0 22px;
  color: var(--muted);
}

.legend {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-grid {
  display: grid;
  gap: 12px;
}

label {
  font-weight: 600;
  margin-top: 4px;
}

.required-mark {
  color: var(--danger);
}

.optional-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: #eef3ff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  vertical-align: middle;
}

.field-help {
  margin: -6px 0 4px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.field-help a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.field-help a:hover {
  text-decoration: underline;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(51, 88, 255, 0.2);
}

textarea {
  resize: vertical;
}

button {
  margin-top: 6px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.05s ease, background-color 0.2s ease;
}

button:hover {
  background: var(--primary-hover);
}

button:active {
  transform: translateY(1px);
}

.message {
  margin: 14px 0 0;
  min-height: 20px;
  font-weight: 600;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--success);
}

.hidden {
  display: none;
}
