:root {
    --hm-teal: #2a7f8f;
    --hm-teal-dark: #1e5f72;
    --hm-teal-light: #f1f5f9;
    --hm-teal-mid: #cbd5e1;
    --hm-text: #1e293b;
    --hm-muted: #64748b;
    --hm-border: #cbd5e1;
    --hm-surface: #f8fafc;
    --hm-error-bg: #fff7ed;
    --hm-error-border: #fdba74;
    --hm-error-text: #9a3412;
    --hm-focus-ring: rgba(42, 127, 143, 0.2);
}

.forms-page-container {
    max-width: 720px;
}

.form-card {
    background: var(--hm-surface);
    border-radius: 12px;
    border: 1px solid var(--hm-border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    padding: 1.25rem;
}

@media (min-width: 576px) {
    .form-card {
        padding: 2rem;
    }
}

.form-section-title,
.form-card h2.h6 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--hm-text);
    margin-bottom: 1rem;
}

.form-intro {
    font-size: 0.925rem;
    color: var(--hm-muted);
    line-height: 1.6;
}

.form-divider {
    border: 0;
    border-top: 1px solid var(--hm-border);
    margin: 1.25rem 0;
    opacity: 1;
}

.form-label,
.choice-fieldset legend.form-label {
    font-weight: 500;
    color: var(--hm-text);
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.form-text {
    color: var(--hm-muted);
    line-height: 1.5;
}

.form-control,
.form-select {
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    border: 1px solid var(--hm-border);
    border-radius: 8px;
    background: #fff;
    color: var(--hm-text);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--hm-teal);
    box-shadow: 0 0 0 3px var(--hm-focus-ring);
}

textarea.form-control {
    min-height: 120px;
    padding: 0.75rem 1rem;
}

.btn-primary {
    background-color: var(--hm-teal-dark);
    border-color: var(--hm-teal-dark);
    min-height: 48px;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    border-radius: 8px;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #164555;
    border-color: #164555;
}

.btn-outline-primary {
    color: var(--hm-teal-dark);
    border-color: var(--hm-teal-dark);
    min-height: 48px;
    border-radius: 8px;
}

.btn-outline-primary:hover {
    background-color: var(--hm-teal-dark);
    border-color: var(--hm-teal-dark);
}

.btn-outline-secondary {
    min-height: 48px;
    border-radius: 8px;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.15rem;
}

.form-check-label {
    line-height: 1.6;
    padding-left: 0.25rem;
}

.form-check {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding-left: 0;
}

.form-check .form-check-input {
    margin-left: 0;
}

.otp-input {
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    text-align: center;
}

/* ── Soft validation / errors ── */
.alert-soft-danger {
    background-color: var(--hm-error-bg);
    border: 1px solid var(--hm-error-border);
    color: var(--hm-error-text);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    line-height: 1.6;
}

.alert-soft-danger ul {
    margin-bottom: 0;
}

.invalid-feedback {
    color: var(--hm-error-text);
}

/* ── Choice cards (radio / checkbox) ── */
.choice-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
}

.choice-fieldset legend {
    float: none;
    width: 100%;
}

.choice-card {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.choice-card input {
    position: absolute;
    opacity: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.choice-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    min-height: 48px;
    padding: 0.875rem 1rem;
    border: 1px solid var(--hm-border);
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.choice-card-label {
    font-weight: 500;
    color: var(--hm-text);
    line-height: 1.4;
    font-size: 0.9375rem;
}

.choice-card-desc {
    font-size: 0.8125rem;
    color: var(--hm-muted);
    line-height: 1.4;
}

.choice-card input:focus-visible + .choice-card-body {
    border-color: var(--hm-teal);
    box-shadow: 0 0 0 3px var(--hm-focus-ring);
}

.choice-card input:checked + .choice-card-body {
    border-color: var(--hm-teal-dark);
    background: var(--hm-teal-light);
    box-shadow: 0 0 0 1px var(--hm-teal-dark);
}

.choice-card input:checked + .choice-card-body::after {
    content: '\F26E';
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 0.5rem;
    right: 0.65rem;
    color: var(--hm-teal-dark);
    font-size: 1rem;
    line-height: 1;
}

.choice-card-body {
    position: relative;
    padding-right: 2rem;
}

.choice-card-compact .choice-card-body {
    padding: 0.75rem 1rem;
    min-height: 48px;
    align-items: center;
}

.choice-card-full .choice-card-body {
    min-height: 52px;
}

.choice-card-grid {
    display: grid;
    gap: 0.75rem;
}

.choice-card-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.choice-card-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.choice-card-grid-days {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.choice-card-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    max-width: 360px;
}

.choice-card-row-3 {
    grid-template-columns: repeat(3, 1fr);
    max-width: none;
}

@media (max-width: 575.98px) {
    .choice-card-grid-2,
    .choice-card-grid-3,
    .choice-card-row-3 {
        grid-template-columns: 1fr;
    }

    .choice-card-row {
        max-width: none;
    }
}

/* ── Forms index (home) ── */
.forms-index {
    background: var(--hm-surface);
    border: 1px solid var(--hm-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.forms-index-lead {
    margin: 0;
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: var(--hm-muted);
    background: var(--hm-teal-light);
    border-bottom: 1px solid var(--hm-border);
    line-height: 1.6;
}

.forms-index-section + .forms-index-section {
    border-top: 1px solid var(--hm-border);
}

.forms-index-heading {
    margin: 0;
    padding: 0.5rem 1rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hm-teal-dark);
    background: #fff;
}

.forms-index-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.forms-index-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    min-height: 48px;
    text-decoration: none;
    color: var(--hm-text);
    border-bottom: 1px solid var(--hm-border);
    transition: background-color 0.15s ease;
}

.forms-index-list li:last-child .forms-index-item {
    border-bottom: none;
}

.forms-index-item:hover,
.forms-index-item:focus {
    background: var(--hm-teal-light);
    color: var(--hm-text);
}

.forms-index-item-featured {
    background: linear-gradient(90deg, rgba(241, 245, 249, 0.8), transparent);
}

.forms-index-item-featured .forms-index-icon {
    background: var(--hm-teal-dark);
    color: #fff;
    border-color: var(--hm-teal-dark);
}

.forms-index-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--hm-teal-light);
    color: var(--hm-teal-dark);
    border: 1px solid var(--hm-teal-mid);
    font-size: 0.95rem;
}

.forms-index-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.forms-index-title {
    font-size: 0.925rem;
    font-weight: 600;
    line-height: 1.35;
}

.forms-index-desc {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--hm-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.forms-index-chevron {
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--hm-teal-dark);
    opacity: 0.55;
}

.forms-index-item:hover .forms-index-chevron,
.forms-index-item:focus .forms-index-chevron {
    opacity: 1;
}

@media (min-width: 576px) {
    .forms-index-item {
        padding: 0.75rem 1rem;
    }

    .forms-index-desc {
        -webkit-line-clamp: 1;
    }
}

.text-muted {
    color: var(--hm-muted) !important;
}

.alert-info {
    background-color: var(--hm-teal-light);
    border-color: var(--hm-teal-mid);
    color: var(--hm-teal-dark);
    line-height: 1.6;
    border-radius: 8px;
}

.progress-bar {
    background-color: var(--hm-teal-dark);
}

.intake-progress .step.active {
    color: var(--hm-teal-dark);
    font-weight: 600;
}
