:root {
    --green-dark: #1a4a2e;
    --green-mid: #2d6e47;
    --green-light: #4a9465;
    --green-pale: #e8f4ec;
    --gold: #c8960a;
    --gold-light: #f5e9c0;
    --slate: #2c3e50;
    --slate-mid: #4a5568;
    --slate-light: #718096;
    --border: #d1dbd4;
    --bg: #f7faf8;
    --white: #ffffff;
    --error: #c0392b;
    --error-bg: #fdf2f0;
    --success: #27ae60;
    --required-dot: #c0392b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    background: var(--bg);
    color: var(--slate);
    font-size: 15px;
    line-height: 1.6;
}

/* ── HEADER ── */
.site-header {
    background: var(--green-dark);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 32px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-mark {
    width: 52px;
    height: 52px;
    background: var(--green-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-mark svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.header-text h1 {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.header-text p {
    font-size: 0.82rem;
    opacity: 0.75;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.progress-bar-wrap {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.progress-label {
    font-size: 0.78rem;
    opacity: 0.8;
}

.progress-track {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gold);
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

/* ── LAYOUT ── */
.layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 80px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    align-items: start;
}

/* ── SIDEBAR NAV ── */
.sidebar {
    position: sticky;
    top: 90px;
}

.sidebar-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--slate-light);
    margin-bottom: 10px;
    padding: 0 4px;
}

.nav-list {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 2px;
    font-size: 0.9rem;
    color: var(--slate-mid);
}

.nav-item:hover {
    background: var(--green-pale);
    color: var(--green-dark);
}

.nav-item.active {
    background: var(--green-dark);
    color: white;
    font-weight: 600;
}

.nav-item.complete {
    color: var(--success);
}

.nav-item.complete .nav-dot {
    background: var(--success);
}

.nav-item.has-errors {
    color: var(--error);
}

.nav-item.has-errors .nav-dot {
    background: var(--error);
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    transition: background 0.2s;
}

.nav-item.active .nav-dot {
    background: rgba(255, 255, 255, 0.6);
}

.nav-badge {
    margin-left: auto;
    font-size: 0.7rem;
    background: var(--gold-light);
    color: var(--gold);
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
}

/* ── MAIN CONTENT ── */
.main-content {
    min-width: 0;
}

.intro-card {
    background: var(--green-dark);
    color: white;
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 28px;
    scroll-margin-top: 100px;
}

.intro-card h2 {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.intro-card p {
    opacity: 0.85;
    font-size: 0.95rem;
    line-height: 1.7;
}

.school-program-inputs {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.school-finder,
.location-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 8px;
    align-items: center;
}

.school-finder input {
    border-color: rgba(255, 255, 255, 0.5);
}

.school-finder button,
.recommendation-actions button,
.location-choice {
    padding: 10px 16px;
    background: white;
    color: var(--green-dark);
    border: 1.5px solid white;
    border-radius: 7px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.school-finder button:hover,
.recommendation-actions button:hover,
.location-choice:hover,
.location-choice.selected {
    background: var(--gold-light);
    border-color: var(--gold-light);
}

.location-choice {
    min-height: 88px;
    text-align: left;
}

.location-choice-name,
.location-choice-address {
    display: block;
}

.location-choice-name {
    font-size: 0.94rem;
    line-height: 1.2;
}

.location-choice-address {
    margin-top: 6px;
    color: var(--slate-mid);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
}

.learning-center-menu {
    margin-top: 10px;
}

.learning-center-menu select {
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--green-dark);
    font-weight: 600;
}

.school-recommendation,
.manual-location {
    margin-top: 12px;
    padding: 14px 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.recommendation-title,
.manual-location-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
}

.recommendation-address,
.manual-location-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.84rem;
    line-height: 1.35;
    opacity: 0.86;
}

.recommendation-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.selected-location {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: white;
    color: var(--green-dark);
    font-size: 0.88rem;
    font-weight: 600;
    display: none;
}

.selected-location.visible {
    display: block;
}

.manual-location select {
    margin-top: 10px;
}

/* ── SECTION CARDS ── */
.section-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 20px;
    scroll-margin-top: 100px;
}

.section-header {
    padding: 18px 28px;
    background: var(--green-pale);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    user-select: none;
}

.section-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--green-dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.section-title-wrap {
    flex: 1;
}

.section-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.05rem;
    color: var(--green-dark);
    font-weight: 700;
}

.section-subtitle {
    font-size: 0.8rem;
    color: var(--slate-light);
    margin-top: 2px;
}

.section-badge {
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.badge-required {
    background: #fee2e2;
    color: var(--error);
}

.badge-optional {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-post {
    background: #fef3c7;
    color: #92400e;
}

.section-chevron {
    font-size: 1.1rem;
    color: var(--slate-light);
    transition: transform 0.2s;
}

.section-card.collapsed .section-chevron {
    transform: rotate(-90deg);
}

.section-body {
    padding: 28px;
}

.section-card.collapsed .section-body {
    display: none;
}

.section-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    padding: 2px 10px;
    border-radius: 10px;
}

.status-complete {
    background: #dcfce7;
    color: var(--success);
}

.status-incomplete {
    background: #fee2e2;
    color: var(--error);
}

.status-partial {
    background: #fef9c3;
    color: #854d0e;
}

/* ── FORM ELEMENTS ── */
.field-group {
    margin-bottom: 20px;
}

.field-row {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.field-row.cols-2 {
    grid-template-columns: 1fr 1fr;
}

.field-row.cols-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.field-row.cols-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.field-row.auto {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--slate-mid);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

label .req {
    color: var(--required-dot);
    margin-left: 2px;
}

label .opt {
    color: var(--slate-light);
    font-weight: 400;
    font-size: 0.78rem;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 4px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.95rem;
    color: var(--slate);
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--green-mid);
    box-shadow: 0 0 0 3px rgba(45, 110, 71, 0.12);
}

input.invalid,
select.invalid,
textarea.invalid {
    border-color: var(--error);
    background: var(--error-bg);
}

.field-error {
    font-size: 0.78rem;
    color: var(--error);
    margin-top: 4px;
    display: none;
}

.field-error.visible {
    display: block;
}

.invalid-group {
    border-radius: 7px;
    outline: 2px solid rgba(192, 57, 43, 0.2);
    outline-offset: 4px;
}

.intro-error {
    color: #fee2e2;
}

.required-star {
    color: #f5c842;
    font-weight: 700;
}

.guardian-2-required {
    color: var(--required-dot);
    display: none;
    margin-left: 2px;
}

#s2.guardian-2-active .guardian-2-required {
    display: inline;
}

.guardian-clear-btn {
    margin-bottom: 14px;
}

.intro-section-label {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 18px;
}

.form-note {
    font-size: 0.82rem;
    color: var(--slate-light);
    margin-bottom: 14px;
}

.form-subsection-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--green-dark);
    margin-bottom: 14px;
}

.form-subsection-title.muted {
    font-size: 0.82rem;
    color: var(--slate-mid);
}

.form-subsection-title.plain {
    color: var(--slate);
}

.muted-inline {
    color: var(--slate-light);
    font-weight: 400;
}

.is-hidden {
    display: none !important;
}

.mb-4 {
    margin-bottom: 4px;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-12 {
    margin-bottom: 12px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mt-8 {
    margin-top: 8px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-20 {
    margin-top: 20px;
}

.doctor-phone {
    max-width: 260px;
}

.school-entry {
    margin-bottom: 20px;
}

.dynamic-entry-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-light);
    margin-bottom: 10px;
}

.secondary-action-btn {
    padding: 8px 18px;
    background: var(--green-pale);
    color: var(--green-dark);
    border: 1.5px solid var(--green-mid);
    border-radius: 6px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.secondary-action-btn.compact {
    padding: 7px 14px;
    font-size: 0.85rem;
}

.secondary-action-btn:hover {
    background: var(--green-dark);
    color: white;
}

.service-select {
    min-width: 70px;
    padding: 4px 8px;
    font-size: 0.82rem;
}

.table-scroll {
    overflow-x: auto;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a5568' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Checkboxes & Radios */
.check-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.check-item,
.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.check-item input,
.radio-item input {
    cursor: pointer;
    accent-color: var(--green-mid);
}

.check-item span,
.radio-item span {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--slate);
    cursor: pointer;
    margin: 0;
}

/* Custody radio inline */
.custody-row {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 8px;
}

/* ── FILE UPLOAD ── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
    position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--green-mid);
    background: var(--green-pale);
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.upload-label {
    font-size: 0.9rem;
    color: var(--slate-mid);
    font-weight: 500;
}

.upload-hint {
    font-size: 0.78rem;
    color: var(--slate-light);
    margin-top: 4px;
}

.upload-files-list {
    margin-top: 12px;
    text-align: left;
}

.upload-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-top: 6px;
    font-size: 0.85rem;
}

.file-icon {
    font-size: 1.1rem;
}

.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: var(--slate-light);
    font-size: 0.78rem;
}

.file-status {
    font-size: 0.78rem;
    font-weight: 600;
}

.file-status.ok {
    color: var(--success);
}

.file-status.warn {
    color: #d97706;
}

.file-remove {
    color: var(--slate-light);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
    border-radius: 3px;
    border: none;
    background: none;
    transition: color 0.15s;
}

.file-remove:hover {
    color: var(--error);
}

/* ── TABLE (services) ── */
.services-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.services-table th {
    background: var(--green-pale);
    color: var(--green-dark);
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
}

.services-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.services-table tr:last-child td {
    border-bottom: none;
}

.services-table input[type="text"] {
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* ── RESIDENCY LIST ── */
.residency-options .check-item {
    width: 100%;
    padding: 10px 14px;
    border-radius: 7px;
    border: 1.5px solid var(--border);
    background: white;
    transition: all 0.15s;
}

.residency-options .check-item:has(input:checked) {
    border-color: var(--green-mid);
    background: var(--green-pale);
}

.residency-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── HEALTH CHECKBOXES ── */
.health-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.health-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.health-item:has(input:checked) {
    border-color: var(--green-mid);
    background: var(--green-pale);
}

.health-item span {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}

.health-item input {
    accent-color: var(--green-mid);
}

/* ── INCOME TABLE ── */
.income-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-top: 12px;
}

.income-table th {
    background: var(--slate);
    color: white;
    padding: 8px 12px;
    text-align: right;
    font-size: 0.75rem;
}

.income-table th:first-child {
    text-align: left;
}

.income-table .income-heading-1,
.income-table .income-heading-2 {
    text-align: center;
}

.income-table .income-heading-1 {
    background: #3a5068;
}

.income-table .income-heading-2 {
    background: #1a4a2e;
}

.income-table td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--border);
    text-align: right;
}

.income-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.income-table tr:nth-child(even) td {
    background: var(--bg);
}

/* ── DIVIDER ── */
.divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* ── INFO BOX ── */
.info-box {
    background: var(--gold-light);
    border-left: 4px solid var(--gold);
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    font-size: 0.88rem;
    color: #5c3a00;
    margin-bottom: 20px;
}

.info-box strong {
    color: #92400e;
}

.info-box ol {
    margin: 8px 0 0 22px;
    padding: 0;
}

.info-box li {
    margin-top: 6px;
}

/* ── SUBMIT SECTION ── */
.submit-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    margin-top: 28px;
}

.submit-section-flush {
    border: none;
    padding: 0;
}

.submit-section h3 {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.2rem;
    color: var(--green-dark);
    margin-bottom: 6px;
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    background: var(--green-dark);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    margin-top: 16px;
    letter-spacing: 0.02em;
}

.submit-btn:hover {
    background: var(--green-mid);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26, 74, 46, 0.3);
}

.submit-btn:disabled {
    background: var(--slate-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.validation-summary {
    background: var(--error-bg);
    border: 1.5px solid var(--error);
    border-radius: 8px;
    padding: 16px 20px;
    margin: 16px 0;
    display: none;
}

.validation-summary.visible {
    display: block;
}

.validation-summary h4 {
    color: var(--error);
    margin-bottom: 8px;
    font-size: 0.92rem;
}

.validation-summary ul {
    padding-left: 20px;
    font-size: 0.85rem;
    color: var(--slate);
}

.validation-summary li {
    margin-bottom: 4px;
}

.validation-link {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--error);
    cursor: pointer;
    font: inherit;
    text-align: left;
    text-decoration: underline;
}

.validation-summary a {
    color: var(--error);
    cursor: pointer;
    text-decoration: underline;
}

.success-banner {
    background: #dcfce7;
    border: 1.5px solid var(--success);
    border-radius: 8px;
    padding: 20px 24px;
    text-align: center;
    display: none;
}

.success-banner.visible {
    display: block;
}

.success-banner h3 {
    color: var(--success);
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.success-banner p {
    font-size: 0.88rem;
    color: var(--slate);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .school-finder,
    .location-picker {
        grid-template-columns: 1fr;
    }

    .field-row.cols-2,
    .field-row.cols-3,
    .field-row.cols-4 {
        grid-template-columns: 1fr;
    }

    .health-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-inner {
        padding: 14px 20px;
    }

    .progress-bar-wrap {
        display: none;
    }

    .section-body {
        padding: 18px;
    }
}
