:root {
    --primary: #0F9A8C;
    --primary-dark: #006145;
    --primary-light: #1DBBA8;
    --brand-sourcing: #00ac87;
    --field-answer-indent: 1.75rem;
    --ao-ink: #1e293b;
    --ao-muted: #64748b;
    --ao-border: #e2e8f0;
    --ao-surface: #ffffff;
    --ao-danger: #ef4444;
    --ao-radius: 14px;
    --ao-shadow: 0 20px 60px rgba(15, 118, 110, 0.12);
    --ao-font: 'Inter', system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--ao-font);
    color: var(--ao-ink);
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%);
    line-height: 1.55;
}

.intake-bg {
    display: none;
}

.intake-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.intake-header-inner {
    max-width: 920px;
    margin: 0 auto;
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.intake-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--ao-ink);
}

.intake-logo {
    height: 22px;
    width: auto;
    display: block;
}

body.welcome-mode .intake-badge {
    display: none;
}

.intake-brand-sourcing {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--brand-sourcing);
    letter-spacing: -0.02em;
    line-height: 1;
}

.intake-badge {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-dark);
    background: rgba(15, 154, 140, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    white-space: nowrap;
}

.intake-main {
    max-width: 920px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.intake-card {
    background: var(--ao-surface);
    border-radius: calc(var(--ao-radius) + 4px);
    box-shadow: var(--ao-shadow);
    border: 1px solid rgba(226, 232, 240, 0.9);
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* Welcome screen */
.welcome-screen {
    padding: 2rem 2rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.welcome-screen::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -80px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 154, 140, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

.welcome-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(15, 154, 140, 0.12);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.85rem;
}

.welcome-hero-copy h1 {
    margin: 0 0 0.85rem;
    font-size: clamp(1.6rem, 4vw, 2.15rem);
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--ao-ink);
}

.welcome-lead {
    margin: 0 0 0.65rem;
    font-size: 1.02rem;
    color: #334155;
    font-weight: 500;
}

.welcome-lead strong {
    color: var(--ao-ink);
}

.welcome-section-box {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    width: 100%;
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    background: rgba(15, 154, 140, 0.06);
    border: 1px solid rgba(15, 154, 140, 0.14);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.welcome-section-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 154, 140, 0.2);
}

.welcome-privacy-box {
    background: #f8fafc;
    border-color: var(--ao-border);
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--ao-muted);
}

.welcome-privacy-title {
    margin: 0 0 0.35rem;
    font-weight: 700;
    color: var(--ao-ink);
    font-size: 0.88rem;
}

.welcome-privacy-box a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.welcome-privacy-box a:hover {
    text-decoration: underline;
}

.welcome-section-box p {
    margin: 0;
    font-size: 0.92rem;
    color: #334155;
    line-height: 1.55;
}

.welcome-section-box a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.welcome-section-box a:hover {
    text-decoration: underline;
}

.welcome-section-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(15, 154, 140, 0.14);
    color: var(--primary-dark);
    font-size: 1rem;
}

.welcome-section-box p strong {
    color: var(--ao-ink);
}

.welcome-stats {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.welcome-stat-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--ao-border);
    box-shadow: 0 4px 16px rgba(15, 154, 140, 0.06);
    font-size: 0.9rem;
    font-weight: 500;
    color: #334155;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.welcome-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 154, 140, 0.12);
}

.welcome-stat-icon {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    background: rgba(0, 172, 135, 0.15);
    color: var(--brand-sourcing);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0.72rem;
}

.welcome-details {
    display: none;
}

.welcome-actions {
    text-align: center;
}

.welcome-section-copy {
    flex: 1;
    min-width: 0;
    opacity: 0;
    animation: welcomeCopyFade 0.35s ease forwards;
}

.welcome-section-enter {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
    animation: welcomeBoxEnter 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.welcome-privacy-box.welcome-section-enter {
    animation-name: welcomeBoxEnterPrivacy;
}

.welcome-section-enter-delay-2 { animation-delay: 0.12s; }
.welcome-section-enter-delay-2 .welcome-section-copy { animation-delay: 0.27s; }

.welcome-section-enter-delay-3 { animation-delay: 0.45s; }
.welcome-section-enter-delay-3 .welcome-section-copy { animation-delay: 0.6s; }

.welcome-section-enter-delay-4 { animation-delay: 0.78s; }
.welcome-section-enter-delay-4 .welcome-section-copy { animation-delay: 0.93s; }

.welcome-section-enter-delay-5 { animation-delay: 1.11s; }
.welcome-section-enter-delay-5 .welcome-section-copy { animation-delay: 1.26s; }

.welcome-section-enter-delay-6 { animation-delay: 1.44s; }
.welcome-section-enter-delay-6 .welcome-section-copy { animation-delay: 1.59s; }

@keyframes welcomeBoxEnter {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.99);
        border-color: transparent;
        background: transparent;
        box-shadow: none;
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        border-color: rgba(15, 154, 140, 0.14);
        background: rgba(15, 154, 140, 0.06);
    }
}

@keyframes welcomeBoxEnterPrivacy {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.99);
        border-color: transparent;
        background: transparent;
        box-shadow: none;
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        border-color: var(--ao-border);
        background: #f8fafc;
    }
}

@keyframes welcomeCopyFade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-reveal-delay-1 { animation-delay: 0.05s; }
.welcome-reveal-delay-7 { animation-delay: 2.15s; }

.welcome-reveal {
    opacity: 0;
    transform: translateY(12px);
    animation: welcomeReveal 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes welcomeReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .welcome-reveal,
    .welcome-section-enter,
    .welcome-section-copy {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .welcome-section-box:hover {
        transform: none;
    }
}

.welcome-screen.is-leaving {
    animation: welcomeLeave 0.35s ease forwards;
}

@keyframes welcomeLeave {
    to {
        opacity: 0;
        transform: translateY(-12px);
    }
}

.form-shell.is-entering {
    animation: formEnter 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes formEnter {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.field-add-all {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.field-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    max-width: 100%;
}

.field-label-row .field-label {
    flex: 1;
    min-width: 0;
}

.form-shell {
    display: block;
}

.progress-wrap {
    padding: 1.25rem 2rem 1.15rem;
    border-bottom: 1px solid var(--ao-border);
    background: linear-gradient(180deg, rgba(15, 154, 140, 0.05) 0%, transparent 100%);
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ao-muted);
    margin-bottom: 0.65rem;
}

.progress-track {
    height: 10px;
    background: #e8edf5;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 999px;
    transition: width 0.35s ease;
    box-shadow: 0 0 12px rgba(15, 154, 140, 0.35);
}

.step-labels {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.35rem;
    margin-top: 1rem;
}

.step-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.45rem 0.2rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    min-width: 0;
}

.step-label:hover {
    background: rgba(87, 70, 227, 0.06);
}

.step-label-num {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #64748b;
    transition: all 0.2s;
}

.step-label-text {
    font-size: 0.62rem;
    font-weight: 600;
    color: #94a3b8;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.step-label.active .step-label-num {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(87, 70, 227, 0.35);
}

.step-label.active .step-label-text {
    color: var(--primary-dark);
}

.step-label.completed .step-label-num {
    background: var(--brand-sourcing);
    color: #fff;
}

.step-label.completed .step-label-text {
    color: var(--primary-dark);
}

.form-banner {
    margin: 1rem 2rem 0;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.92rem;
    font-weight: 500;
}

.form-banner.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.form-banner.demo {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.form-banner.demo code {
    font-size: 0.85em;
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.7);
}

.intake-form {
    padding: 1.5rem 2rem 2rem;
    min-width: 0;
    max-width: 100%;
}

.form-step {
    display: none;
    animation: fadeSlide 0.35s ease;
    min-width: 0;
    max-width: 100%;
}

.form-step.active {
    display: block;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-header {
    margin-bottom: 0;
}

.step-divider {
    margin-top: 1rem;
    height: 1px;
    background: var(--ao-border);
}

.step-body {
    margin-top: 1.15rem;
    padding: 1.35rem 1.5rem;
    background: #f8fafc;
    border: 1px solid var(--ao-border);
    border-radius: 12px;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.step-number {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.35rem;
}

.step-header h2 {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.step-desc {
    margin: 0.45rem 0 0;
    color: var(--ao-muted);
    font-size: 0.95rem;
    font-style: italic;
}

.step-fields {
    display: grid;
    gap: 1.15rem;
    min-width: 0;
    max-width: 100%;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    max-width: 100%;
}

.form-field > .field-label-row,
.form-field > label.field-label,
.form-field > p.field-label {
    width: 100%;
    padding-left: 0;
    margin-left: 0;
}

.field-answers {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-left: var(--field-answer-indent);
    width: calc(100% - var(--field-answer-indent));
    max-width: calc(100% - var(--field-answer-indent));
    min-width: 0;
    box-sizing: border-box;
}

.field-answers > * {
    max-width: 100%;
}

.scenario-prompt {
    margin: 0;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--ao-border);
    font-size: 0.9rem;
    line-height: 1.55;
    color: #334155;
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.field-label {
    font-weight: 600;
    font-size: 0.92rem;
    color: #1e293b;
}

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

.form-field[data-field-type="scenario"] .scenario-prompt {
    margin-top: -0.1rem;
}

.field-answers select,
.picker-row select {
    text-transform: capitalize;
}

.field-hint-plain {
    background: none;
    border: none;
    padding: 0;
    font-style: italic;
}

.field-hint {
    margin: 0;
    font-size: 0.82rem;
    color: var(--ao-muted);
    line-height: 1.45;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    background: rgba(0, 208, 163, 0.06);
    border: 1px solid rgba(0, 208, 163, 0.2);
    font-style: italic;
}

.other-field-wrap {
    margin-top: 0.5rem;
}

.picker-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    max-width: 100%;
}

.picker-row select,
.picker-row input[type="text"] {
    flex: 1 1 120px;
    min-width: 0;
    max-width: 100%;
}

.language-picker,
.multi-add {
    max-width: 100%;
    min-width: 0;
}

.btn-add {
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    background: rgba(87, 70, 227, 0.1);
    color: var(--primary-dark);
    border: 1px solid rgba(87, 70, 227, 0.25);
    flex-shrink: 0;
}

.btn-add:hover {
    background: rgba(87, 70, 227, 0.16);
}

.picker-tags {
    list-style: none;
    margin: 0.65rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.picker-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.55rem 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(87, 70, 227, 0.08);
    border: 1px solid rgba(87, 70, 227, 0.2);
    font-size: 0.85rem;
    font-weight: 500;
    max-width: 100%;
}

.picker-tag span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.picker-remove {
    border: none;
    background: transparent;
    color: var(--ao-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
}

.picker-remove:hover {
    color: var(--ao-danger);
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
}

.check-day {
    flex: 1 1 calc(14.28% - 0.35rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.35rem;
    border: 1px solid var(--ao-border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--ao-muted);
    transition: all 0.2s;
    min-width: 0;
    max-width: 100%;
    text-align: center;
    line-height: 1.2;
}

.check-day:has(input:checked) {
    border-color: var(--primary);
    background: rgba(87, 70, 227, 0.08);
    color: var(--primary-dark);
}

.check-day input {
    accent-color: var(--primary);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
select,
textarea {
    width: 100%;
    max-width: 100%;
    font: inherit;
    font-size: 0.95rem;
    padding: 0.72rem 0.9rem;
    border: 1px solid var(--ao-border);
    border-radius: 10px;
    background: #fff;
    color: var(--ao-ink);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(87, 70, 227, 0.12);
}

textarea {
    resize: vertical;
    min-height: 110px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    gap: 0.55rem;
    max-width: 100%;
}

.check-pill {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--ao-border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.88rem;
    transition: border-color 0.2s, background 0.2s;
    min-width: 0;
    max-width: 100%;
}

.check-pill span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.check-pill:has(input:checked) {
    border-color: var(--primary);
    background: rgba(87, 70, 227, 0.06);
}

.check-pill input {
    margin-top: 0.15rem;
    accent-color: var(--primary);
}

.scale-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    max-width: 100%;
}

.scale-row-wide {
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--ao-border);
    border-radius: 12px;
    background: #fafbfc;
    box-sizing: border-box;
}

.scale-options {
    display: flex;
    flex: 1 1 auto;
    justify-content: space-evenly;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    max-width: 100%;
}

.scale-end {
    font-size: 0.78rem;
    color: var(--ao-muted);
    flex: 0 0 auto;
}

.scale-end-left,
.scale-end-right {
    flex: 0 0 auto;
}

@media (max-width: 560px) {
    .scale-row-wide {
        flex-direction: column;
        align-items: stretch;
    }

    .scale-options {
        justify-content: space-between;
    }

    .scale-end-left,
    .scale-end-right {
        text-align: center;
    }
}

.scale-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}

.scale-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.scale-option span {
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid var(--ao-border);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.resume-upload-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    max-width: 100%;
}

.file-upload {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    border: 1px dashed var(--primary);
    background: rgba(87, 70, 227, 0.05);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
}

.file-upload:hover {
    background: rgba(87, 70, 227, 0.1);
}

input[type="file"]#resume_file {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.file-name {
    font-size: 0.85rem;
    color: var(--ao-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    max-width: 100%;
}

.resume-or {
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ao-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

#self_evaluation .form-field,
.form-step[data-step="4"] .form-field {
    gap: 0.55rem;
}

.form-step[data-step="4"] .scale-row-wide {
    margin-top: 0.15rem;
}

.scale-option input:checked + span,
.scale-option:hover span {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.consent-label {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border: 1px solid var(--ao-border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.45;
}

.consent-label:has(input:checked) {
    border-color: var(--brand-sourcing);
    background: rgba(0, 208, 163, 0.06);
}

.consent-label input {
    margin-top: 0.2rem;
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary-dark);
}

.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea,
.form-field.has-error .check-pill,
.form-field.has-error .consent-label {
    border-color: #fca5a5;
}

.field-error {
    margin: 0;
    font-size: 0.82rem;
    color: var(--ao-danger);
    font-weight: 500;
}

.form-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ao-border);
}

.form-nav.step-first {
    grid-template-columns: 1fr;
}

.form-nav #prevBtn {
    justify-self: start;
}

.form-nav #nextBtn,
.form-nav #submitBtn {
    justify-self: end;
}

.form-nav.step-first #nextBtn {
    justify-self: end;
}

.form-nav.step-last #submitBtn {
    justify-self: end;
}

.form-nav [hidden] {
    display: none !important;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.78rem 1.25rem;
    border-radius: 10px;
    border: none;
    font: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 8px 20px rgba(15, 154, 140, 0.28);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 154, 140, 0.34);
}

.btn-ghost {
    background: transparent;
    color: var(--ao-muted);
    border: 1px solid var(--ao-border);
}

.btn-ghost:hover:not(:disabled) {
    background: #f8fafc;
    color: var(--ao-ink);
}

.btn-submit {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 8px 20px rgba(15, 154, 140, 0.28);
    margin-left: auto;
}

.btn-submit:hover {
    transform: translateY(-1px);
}

.btn-lg,
.btn-start-form {
    width: 100%;
    max-width: 420px;
    padding: 0.95rem 1.5rem;
    font-size: 1rem;
}

.privacy-notice {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 2rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid var(--ao-border);
    font-size: 0.82rem;
    color: var(--ao-muted);
}

.privacy-notice i {
    color: var(--primary);
    margin-top: 0.15rem;
}

.privacy-notice a {
    color: var(--primary);
    font-weight: 600;
}

.success-card {
    padding: 3rem 2rem;
    text-align: center;
}

.submit-progress-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}

.submit-progress-overlay.hidden {
    display: none;
}

body.submit-progress-active {
    overflow: hidden;
}

.submit-progress-card {
    width: min(100%, 420px);
    background: #fff;
    border-radius: 18px;
    padding: 2rem 1.75rem 1.5rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(15, 154, 140, 0.12);
    text-align: center;
}

.submit-progress-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 154, 140, 0.1);
    color: var(--primary-dark);
    font-size: 1.35rem;
}

.submit-progress-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    color: #0f172a;
}

.submit-progress-label {
    margin: 0 0 1rem;
    color: var(--ao-muted);
    font-size: 0.92rem;
}

.submit-progress-track {
    height: 10px;
    background: #e8edf5;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.submit-progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 999px;
    transition: width 0.45s ease;
    box-shadow: 0 0 12px rgba(15, 154, 140, 0.35);
}

.submit-progress-hint {
    margin: 1rem 0 0;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Thank-you confirmation (post-submit) */
body.thankyou-active {
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%);
}

body.thankyou-active .intake-bg {
    display: none;
}

body.thankyou-active .intake-header,
body.thankyou-active .intake-footer {
    display: none;
}

.thankyou-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

.thankyou-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.thankyou-logo-img {
    height: 32px;
    width: auto;
}

.thankyou-brand-sourcing {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--brand-sourcing);
}

.thankyou-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem 2rem 1.5rem;
    box-shadow: var(--ao-shadow);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.thankyou-card h1 {
    margin: 0 0 1rem;
    font-size: clamp(1.35rem, 4vw, 1.65rem);
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.thankyou-check {
    font-style: normal;
}

.thankyou-lead {
    margin: 0 0 1.5rem;
    color: #475569;
    line-height: 1.6;
    font-size: 0.95rem;
}

.thankyou-next-box {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    margin-bottom: 1.5rem;
}

.thankyou-next-box h2 {
    margin: 0 0 0.75rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
}

.thankyou-next-box ol {
    margin: 0;
    padding-left: 1.2rem;
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.55;
}

.thankyou-next-box li + li {
    margin-top: 0.45rem;
}

.thankyou-community {
    margin: 0 0 1rem;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.55;
}

.btn-marketplace {
    display: flex;
    width: 100%;
    justify-content: center;
    padding: 0.95rem 1.25rem;
    border-radius: 999px;
    background: var(--brand-sourcing);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 172, 135, 0.35);
    transition: transform 0.15s, box-shadow 0.2s;
}

.btn-marketplace:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(0, 208, 163, 0.45);
    color: #fff;
}

.thankyou-signoff {
    margin: 1.5rem 0 0.75rem;
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.5;
}

.thankyou-fineprint {
    margin: 0;
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.45;
}

.thankyou-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--ao-muted);
    line-height: 1.6;
}

.thankyou-footer a {
    color: var(--brand-sourcing);
    text-decoration: none;
    font-weight: 600;
}

.thankyou-footer a:hover {
    text-decoration: underline;
}

.reveal {
    animation: fadeSlide 0.5s ease;
}

.intake-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.82rem;
    color: var(--ao-muted);
}

@media (max-width: 768px) {
    .welcome-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .step-labels {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .welcome-screen,
    .progress-wrap,
    .intake-form {
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }

    .step-labels {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .step-label-text {
        display: none;
    }

    .checkbox-row {
        flex-wrap: wrap;
    }

    .check-day {
        flex: 1 1 calc(25% - 0.35rem);
    }

    .step-body {
        padding: 1.15rem 1rem;
    }

    .field-answers {
        margin-left: 1.25rem;
        width: calc(100% - 1.25rem);
        max-width: calc(100% - 1.25rem);
    }

    .form-banner {
        margin-left: 1.15rem;
        margin-right: 1.15rem;
    }

    .intake-badge {
        display: none;
    }

    .form-nav.step-first {
        grid-template-columns: 1fr;
    }

    .form-nav.step-last {
        grid-template-columns: 1fr 1fr;
    }

    .form-nav.step-last #prevBtn {
        justify-self: start;
    }

    .form-nav.step-last #submitBtn {
        justify-self: end;
        width: auto;
        max-width: none;
    }
}

.intake-honeypot {
    display: none !important;
}

/* Multi-form variant panels */
.variant-step-hint {
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.variant-none-hint {
    margin: 0 0 1.25rem;
    padding: 1rem 1.15rem;
    border-radius: 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 0.92rem;
    line-height: 1.5;
}

.variant-none-hint i {
    color: var(--primary);
    margin-right: 0.35rem;
}

.variant-panel {
    margin-bottom: 1.5rem;
}

.variant-panel-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.variant-panel-desc {
    margin: 0 0 1rem;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.5;
}
