:root {
  color-scheme: light;
  --bg: #f7f5f6;
  --surface: #ffffff;
  --text: #2b2b2f;
  --muted: #6f6b72;
  --placeholder: #a89ea5;
  --primary: #a11f2f;
  --primary-hover: #851927;
  --border: #e8dadd;
  --accent: #c93547;
  --accent-soft: #fdf0f2;
  --field-filled-bg: #fff6f8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at 10% 0%, #fff6f7 0%, #f9f4f5 42%, #f8f7f8 100%);
  color: var(--text);
}

.site-header {
  position: relative;
  top: 0;
  z-index: 30;
}

.main-nav {
  background: #fff;
  border-bottom: 1px solid #ead9dd;
  box-shadow: 0 3px 14px rgba(80, 33, 40, 0.08);
}

.main-nav-content {
  width: min(1100px, 94vw);
  margin: 0 auto;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  width: 178px;
  height: auto;
}

.header-mini-label {
  color: #7a2a36;
  font-size: 0.83rem;
  font-weight: 700;
  background: #fdf0f2;
  border: 1px solid #efc8cf;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
}

.header-info-band {
  background: linear-gradient(120deg, #8b1a2a, #a11f2f 52%, #c93547);
  border-bottom: 1px solid #8e1f2f;
  box-shadow: 0 8px 20px rgba(118, 25, 38, 0.2);
}

.header-info-content {
  width: min(1100px, 94vw);
  margin: 0 auto;
  padding: 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-tooth {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  flex: 0 0 auto;
}

.header-info-text {
  color: #fff;
}

.header-info-text strong {
  display: block;
  font-size: 1.02rem;
}

.header-info-text p {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
  opacity: 0.94;
}

.header-info-tags {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.header-info-tags span {
  color: #fff;
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0.25rem 0.58rem;
}

.container {
  width: min(1100px, 94vw);
  margin: 1rem auto 3rem;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  box-shadow: 0 8px 24px rgba(91, 35, 43, 0.08);
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: 1.7rem;
  color: #7f1a29;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.hero-highlights {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.45rem;
}

.highlight-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #5e2b33;
}

.highlight-item span {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fdecef;
}

.highlight-item small {
  font-size: 0.82rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.15rem;
  box-shadow: 0 10px 24px rgba(76, 35, 41, 0.07);
}

.form-card h2 {
  margin-top: 0;
  font-size: 1.12rem;
  color: #8b1a2a;
}

.form-card>.dependents-head:first-of-type {
  margin-top: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.field span {
  color: #4d3a3e;
  font-weight: 600;
}

input {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.7rem;
  font-size: 0.93rem;
  color: var(--text);
  outline: none;
  background: #fff;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(161, 31, 47, 0.16);
}

select,
textarea {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.7rem;
  font-size: 0.93rem;
  color: var(--text);
  outline: none;
  background: #fff;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

input.is-filled,
select.is-filled,
textarea.is-filled {
  background: var(--field-filled-bg);
  border-color: #e9cdd3;
}

select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(161, 31, 47, 0.16);
}

.dependents-head {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #ead9dd;
  padding: 0.25rem 0 0.55rem;
}

.dependents-head h2 {
  margin: 0;
  padding-left: 0.6rem;
  border-left: 4px solid #b1283a;
}

.hint {
  color: var(--muted);
  margin: 0.45rem 0 1rem;
}

.dependents-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dependent-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  background: linear-gradient(180deg, #fffefe 0%, #fcf7f8 100%);
}

.dependent-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.dependent-title h3 {
  margin: 0;
  font-size: 1rem;
}

.six-columns {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.actions {
  margin-top: 1.3rem;
}

.btn-primary,
.btn-secondary,
.remove-dependent {
  border: 0;
  border-radius: 12px;
  padding: 0.62rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.btn-primary {
  background: linear-gradient(120deg, #8b1a2a, var(--primary));
  color: #fff;
  box-shadow: 0 8px 18px rgba(141, 27, 43, 0.26);
}

.btn-primary:hover {
  background: linear-gradient(120deg, #741523, var(--primary-hover));
  transform: translateY(-1px);
}

.btn-secondary,
.remove-dependent {
  background: #fdf0f2;
  color: #872131;
  border: 1px solid #efc8cf;
}

.btn-secondary:hover,
.remove-dependent:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(126, 33, 46, 0.16);
}

.inline-button {
  text-decoration: none;
  display: inline-block;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(44, 19, 24, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 999;
}

.modal.is-open {
  display: flex;
}

.modal-card {
  width: min(760px, 96vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(68, 20, 27, 0.2);
  padding: 1rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #8b1a2a;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(50, 18, 24, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-overlay.is-visible {
  display: flex;
}

.loading-box {
  min-width: 250px;
  background: #fff;
  border: 1px solid #ecdde0;
  border-radius: 14px;
  box-shadow: 0 18px 38px rgba(83, 24, 33, 0.2);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.loading-box p {
  margin: 0;
  color: #612c33;
  font-weight: 600;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #f0d2d8;
  border-top-color: #9d2233;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 700px) {
  .main-nav-content {
    min-height: auto;
    padding: 0.65rem 0;
    flex-wrap: nowrap;
  }

  .header-mini-label {
    display: none;
  }

  .header-info-content {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .header-info-tags {
    margin-left: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .dependents-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
}