:root {
  --bg: #0b1020;
  --surface: rgba(255, 255, 255, 0.12);
  --surface-strong: rgba(255, 255, 255, 0.18);
  --stroke: rgba(255, 255, 255, 0.22);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.7);
  --muted2: rgba(255, 255, 255, 0.55);
  --danger: #fb7185;
  --focus: rgba(167, 139, 250, 0.7);
  --shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.22);
  --radius: 18px;
  --radius-sm: 14px;
  --max: 760px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(900px 500px at 10% 10%, rgba(167, 139, 250, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(59, 130, 246, 0.16), transparent 55%),
    radial-gradient(900px 600px at 70% 100%, rgba(56, 189, 248, 0.12), transparent 50%), var(--bg);
  color: var(--text);
}

.container {
  max-width: var(--max);
  padding: 28px 16px 48px;
  margin: 0 auto;
}

.header h1 {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.2;
}

.subhead {
  margin: 0 0 18px;
  color: var(--muted);
}

.req {
  color: var(--danger);
}

.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 14px 14px 10px;
  backdrop-filter: blur(22px);
}

.section,
.subsection {
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  margin: 10px 0;
  overflow: clip;
}

.section > summary,
.subsection > summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 14px;
  font-weight: 650;
  letter-spacing: 0.2px;
}

summary::-webkit-details-marker {
  display: none;
}

.section > summary::after,
.subsection > summary::after {
  content: "▸";
  float: right;
  transform: translateY(-1px);
  color: var(--muted2);
  transition: transform 180ms ease;
}

details[open] > summary::after {
  transform: rotate(90deg) translateX(2px) translateY(-1px);
}

.sectionBody {
  padding: 0 14px 14px;
}

.field {
  margin-top: 12px;
}

label,
legend {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(11, 16, 32, 0.55);
  color: var(--text);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
}

.help {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted2);
}

.grid2 {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .grid2 {
    grid-template-columns: 1fr 1fr;
  }
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.radioRow {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.radioRow label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: var(--text);
  font-weight: 500;
}

.radioRow input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.actions {
  padding: 12px 4px 6px;
}

.primary {
  width: 100%;
  border: 0;
  border-radius: 18px;
  height: 48px;
  font-weight: 650;
  color: var(--text);
  cursor: pointer;
  background: linear-gradient(135deg, #a78bfa, #6366f1 55%, #3b82f6);
  box-shadow: 0 14px 40px -18px rgba(0, 0, 0, 0.5);
}

.primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.fineprint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted2);
  text-align: center;
}

.status {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
  min-height: 20px;
}

.hidden {
  display: none !important;
}

.hp {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

/* ── File upload ── */
input[type="file"] {
  padding: 8px;
}

input[type="file"]::file-selector-button {
  background: linear-gradient(135deg, #a78bfa, #6366f1);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 6px 16px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 12px;
}

.image-preview {
  display: block;
  margin-top: 10px;
  max-width: 120px;
  max-height: 120px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  object-fit: cover;
}

/* ── Add / Remove buttons ── */
.addBtn {
  display: inline-block;
  margin-top: 8px;
  padding: 7px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 180ms, color 180ms;
}

.addBtn:hover {
  border-color: var(--focus);
  color: var(--text);
}

.removeBtn {
  padding: 4px 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(251, 113, 133, 0.18);
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.removeBtn:hover {
  background: rgba(251, 113, 133, 0.3);
}

/* ── Dynamic entries ── */
.dynamic-entry {
  margin-top: 8px;
}

.dynamic-entry.has-remove {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dynamic-entry.has-remove > input,
.dynamic-entry.has-remove > select {
  flex: 1;
}

.special-day-entry {
  padding: 8px 0;
}

.special-day-entry .grid2 {
  flex: 1;
}

.special-day-entry.has-remove {
  display: flex;
  align-items: flex-start;
}

/* ── Spouse entry ── */
.spouse-entry {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.spouse-entry:last-child {
  border-bottom: 0;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.entry-header h4 {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

