
:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  background: #f7f6f1;
  color: #203330;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px max(24px, calc((100vw - 1120px) / 2));
  background: #152b29;
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 21px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.brand strong {
  color: #e9bf72;
}

.brand-icon {
  font-size: 27px;
}

.account-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #314b47;
}

.header-username {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-button {
  border: 1px solid #6c8580;
  border-radius: 9px;
  padding: 9px 13px;
  background: transparent;
  color: #fff;
  white-space: nowrap;
}

.text-button:hover {
  background: #29443f;
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.welcome-section {
  margin-bottom: 40px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #94703a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.8px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 43px);
  line-height: 1.2;
  letter-spacing: -1px;
}

.welcome-section > p:last-child {
  color: #6b7974;
  font-size: 16px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: 21px;
}

.section-note {
  color: #89938e;
  font-size: 12px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 240px;
  padding: 28px;
  border: 1px solid #e6e8e0;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 4px 18px rgb(25 40 34 / 3%);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 49px;
  height: 49px;
  margin-bottom: 20px;
  border-radius: 13px;
  background: #edf3eb;
  font-size: 25px;
}

.feature-card h3 {
  margin-bottom: 9px;
  font-size: 19px;
}

.feature-card p {
  flex: 1;
  max-width: 390px;
  margin-bottom: 20px;
  color: #71807a;
  font-size: 14px;
  line-height: 1.65;
}

.coming-soon {
  display: inline-block;
  padding: 7px 11px;
  border-radius: 20px;
  background: #f0f1eb;
  color: #77817a;
  font-size: 12px;
  font-weight: 700;
}

.admin-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
  padding: 26px 28px;
  border: 1px solid #d6e2d9;
  border-radius: 17px;
  background: #edf4ef;
}

.admin-panel h2 {
  margin-bottom: 8px;
  font-size: 19px;
}

.admin-panel p:last-child {
  margin-bottom: 0;
  color: #6c7d71;
  font-size: 14px;
  line-height: 1.5;
}

.center-panel {
  max-width: 540px;
  margin: 60px auto;
  text-align: center;
}

.hero-icon {
  margin-bottom: 22px;
  font-size: 65px;
}

.center-panel h1 {
  margin-bottom: 18px;
}

.intro,
.center-panel > p:not(.eyebrow) {
  color: #71807a;
  line-height: 1.7;
}

.primary-button {
  display: inline-block;
  margin-top: 18px;
  padding: 15px 25px;
  border: 0;
  border-radius: 11px;
  background: #225347;
  color: white;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.primary-button:hover {
  background: #173e35;
}

.fine-print {
  margin-top: 25px;
  font-size: 12px;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 20px;
  border: 3px solid #dce5dd;
  border-top-color: #225347;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px max(24px, calc((100vw - 1120px) / 2));
  border-top: 1px solid #e6e8e0;
  color: #89938e;
  font-size: 12px;
}

@media (max-width: 640px) {
  .site-header {
    padding: 15px 18px;
  }

  .brand {
    font-size: 18px;
  }

  .brand-icon {
    font-size: 23px;
  }

  .header-username {
    display: none;
  }

  .account-controls {
    gap: 8px;
  }

  .avatar {
    width: 32px;
    height: 32px;
  }

  .text-button {
    padding: 8px 10px;
    font-size: 12px;
  }

  .main-content {
    padding: 36px 18px 55px;
  }

  .welcome-section {
    margin-bottom: 30px;
  }

  .section-heading {
    display: block;
  }

  .section-note {
    display: block;
    margin-top: 6px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .feature-card {
    min-height: 0;
    padding: 23px;
  }

  .feature-icon {
    margin-bottom: 15px;
  }

  .admin-panel {
    align-items: flex-start;
    flex-direction: column;
    padding: 23px;
  }

  .center-panel {
    margin: 45px auto;
  }

  .site-footer {
    padding: 20px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation: none;
  }
}

/* Family management */

.family-page {
  max-width: 900px;
  margin: 0 auto;
}

.family-section {
  margin-bottom: 24px;
  padding: 26px;
  border: 1px solid #e6e8e0;
  border-radius: 16px;
  background: #fff;
}

.family-section h2 {
  margin-bottom: 8px;
  font-size: 21px;
}

.family-section > p {
  color: #71807a;
  font-size: 14px;
  line-height: 1.6;
}

.family-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.family-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid #e6e8e0;
  border-radius: 11px;
}

.family-person {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.family-person strong {
  overflow-wrap: anywhere;
}

.family-person span,
.family-household,
.family-empty {
  color: #71807a;
  font-size: 13px;
}

.family-household {
  text-align: right;
}

#family-status:not(:empty) {
  margin-bottom: 20px;
  color: #225347;
  font-weight: 600;
}

@media (max-width: 640px) {
  .family-section {
    padding: 20px;
  }

  .family-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .family-household {
    text-align: left;
  }
}

/* Questionnaire */

.questionnaire-page {
  max-width: 900px;
  margin: 0 auto;
}

.back-button {
  padding: 10px 0;
  margin-bottom: 24px;
  border: 0;
  background: transparent;
  color: #225347;
  font-weight: 700;
}

.questionnaire-heading {
  margin-bottom: 28px;
}

.questionnaire-heading > p:last-child {
  max-width: 640px;
  color: #71807a;
  line-height: 1.7;
}

.questionnaire-section {
  margin-bottom: 16px;
  border: 1px solid #e6e8e0;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.questionnaire-section summary {
  padding: 22px 24px;
  color: #203330;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
}

.questionnaire-section summary:focus-visible {
  outline: 3px solid #e9bf72;
  outline-offset: -3px;
}

.questionnaire-section[open] summary {
  border-bottom: 1px solid #e6e8e0;
}

.questionnaire-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  padding: 24px;
}

.questionnaire-fields label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  color: #344c45;
  font-size: 14px;
  font-weight: 700;
}

.questionnaire-fields input,
.questionnaire-fields textarea {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #cbd7d0;
  border-radius: 10px;
  background: #fff;
  color: #203330;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
}

.questionnaire-fields textarea {
  resize: vertical;
  line-height: 1.5;
}

.questionnaire-fields input:focus,
.questionnaire-fields textarea:focus {
  outline: 2px solid #225347;
  outline-offset: 1px;
  border-color: #225347;
}

.full-width-field {
  grid-column: 1 / -1;
}

.questionnaire-savebar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding: 16px 20px;
  border: 1px solid #dce5dd;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 -5px 24px rgb(25 40 34 / 9%);
}

.questionnaire-savebar p {
  margin: 0;
  color: #71807a;
  font-size: 13px;
}

.questionnaire-savebar .primary-button {
  flex-shrink: 0;
  margin: 0;
}

.verification-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid #e9d7ad;
  border-radius: 14px;
  background: #fff9ec;
}

.verification-banner h2 {
  margin-bottom: 8px;
  font-size: 19px;
}

.verification-banner p {
  margin: 0;
  color: #76674b;
  font-size: 14px;
  line-height: 1.6;
}

.secondary-button {
  flex-shrink: 0;
  padding: 12px 18px;
  border: 1px solid #225347;
  border-radius: 10px;
  background: #fff;
  color: #225347;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

@media (max-width: 640px) {
  .questionnaire-fields {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 20px;
  }

  .questionnaire-section summary {
    padding: 19px 20px;
    font-size: 17px;
  }

  .verification-banner {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }

  .questionnaire-savebar {
    gap: 12px;
    padding: 12px;
    margin-left: -6px;
    margin-right: -6px;
  }

  .questionnaire-savebar .primary-button {
    padding: 13px 16px;
    font-size: 14px;
  }

  .questionnaire-savebar p {
    font-size: 12px;
  }
}
