.grid-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.multi-step-form {
    gap: 2rem;
}

.form-progress {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    border-radius: 18px;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.2);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.form-progress::-webkit-scrollbar {
    display: none;
}

.progress-step {
    flex: 1 1 220px;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid transparent;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    color: var(--muted);
    scroll-snap-align: start;
}

.progress-step .step-index {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 600;
    background: rgba(148, 163, 184, 0.15);
    color: var(--text);
}

.progress-step .step-label {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.progress-step.is-active {
    border-color: var(--primary);
    color: var(--text);
    background: rgba(56, 189, 248, 0.08);
    box-shadow: 0 10px 30px -15px rgba(56, 189, 248, 0.5);
}

.progress-step.is-complete {
    border-color: rgba(56, 189, 248, 0.45);
    color: var(--text);
}

.form-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.form-step {
    display: none;
    flex-direction: column;
    gap: 1.25rem;
}

.form-step.is-active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

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

.step-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.step-actions.is-final {
    justify-content: space-between;
    align-items: center;
}

.step-nav {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text);
    font-weight: 600;
    padding: 0.65rem 1.6rem;
    min-height: 44px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.step-nav.primary-btn {
    border-color: transparent;
}

.step-nav:not(.primary-btn):hover {
    border-color: var(--primary);
    color: var(--primary);
}

.form-category {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.5);
    padding: 1.5rem;
}

.form-category + .form-category {
    margin-top: 1rem;
}

.form-category-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
    letter-spacing: 0.02em;
}

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

.form-category .environment-group {
    margin-top: 1.2rem;
}

.ev-section {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.55);
    padding: 1.25rem 1.5rem;
}

.ev-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.35rem;
}

.ev-toggle input {
    width: 1.1rem;
    height: 1.1rem;
}

.ev-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.85rem;
}

.ev-fields.is-hidden {
    display: none;
}

.ev-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.ev-field input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text);
    font-size: 0.95rem;
}

.ev-field input:disabled {
    opacity: 0.55;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.form-group.full {
    grid-column: 1 / -1;
}

.input-combo {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.input-combo input {
    flex: 1;
}

.input-combo select {
    min-width: 130px;
}

label {
    font-weight: 600;
}

.form-label {
    font-weight: 600;
}

input[type="number"],
input[type="text"],
textarea,
select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 1rem;
    width: 100%;
    min-width: 0;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23e2e8f0' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
    position: relative;
}

select:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.7);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

select option {
    background-color: #0f172a;
    color: var(--text);
}

input[type="checkbox"] {
    accent-color: var(--primary);
}

textarea {
    resize: vertical;
}

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

.range-value {
    font-weight: 600;
    font-size: 0.95rem;
}

.field-hint {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.form-actions {
    display: flex;
    justify-content: center;
    align-items: center;
}

.form-actions.full {
    grid-column: 1 / -1;
    width: 100%;
}

.environment-group {
    margin-top: 0.5rem;
}

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

.environment-card {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.environment-card label {
    font-weight: 600;
}

.environment-card-azimuth {
    grid-column: 1 / -1;
}

.roof-type-group {
    gap: 0.75rem;
}

.roof-type-options {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.roof-type-option {
    position: relative;
    display: inline-flex;
}

.roof-type-option input {
    position: absolute;
    opacity: 0;
    inset: 0;
}

.roof-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.6rem;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    width: 110px;
}

.roof-type-card img {
    display: block;
    width: 100%;
    max-width: 90px;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.4);
}

.roof-type-name {
    font-weight: 600;
}

.roof-type-option input:checked + .roof-type-card {
    border-color: var(--primary);
    box-shadow: 0 12px 30px -12px rgba(56, 189, 248, 0.45);
    transform: translateY(-2px);
}

.roof-type-option input:focus-visible + .roof-type-card {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.azimuth-select {
    width: 100%;
    margin-top: 0.4rem;
}

.azimuth-help {
    color: var(--muted);
    font-size: 0.8rem;
    display: block;
    margin-top: 0.5rem;
}

.hero-highlights {
    list-style: none;
    display: grid;
    gap: 0.5rem;
    padding-left: 1.2rem;
    position: relative;
}

.hero-highlights li {
    position: relative;
    color: var(--muted);
}

.hero-highlights li::before {
    content: "-";
    position: absolute;
    left: -1.2rem;
    color: var(--primary);
    font-weight: 700;
}

.info-card ul {
    list-style: disc;
    margin-left: 1.5rem;
    color: var(--muted);
}

@media (max-width: 768px) {
    .grid-form {
        gap: 1.25rem;
    }

    .form-progress {
        flex-direction: row;
        flex-wrap: nowrap;
        padding: 0.6rem;
        gap: 0.75rem;
        scroll-snap-type: x mandatory;
    }

    .step-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .step-actions button {
        width: 100%;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .form-category {
        padding: 1.1rem;
    }

    .progress-step {
        padding: 0.75rem 0.85rem;
        min-width: clamp(160px, 68vw, 220px);
    }

    .progress-step .step-label {
        font-size: 0.9rem;
    }

    .input-combo {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .input-combo input,
    .input-combo select {
        width: 100%;
    }

    .input-combo select {
        min-width: 0;
    }

    .form-category .environment-group {
        margin-top: 0.85rem;
    }

    .card h2,
    .card h3 {
        font-size: 1.05rem;
    }
}

@media (max-width: 640px) {
    .roof-type-options {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.75rem;
    }

    .roof-type-card {
        width: 140px;
        min-height: 170px;
    }

    .step-nav,
    .primary-btn {
        min-height: 44px;
    }
}

.hero-card h1 {
    font-size: clamp(2rem, 3vw + 1.25rem, 2.875rem);
    margin-bottom: 0.35rem;
}

.hero-subtitle {
    color: var(--muted);
    margin-top: -0.35rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.seo-copy {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    line-height: 1.7;
}

.seo-copy a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.seo-copy a:hover {
    text-decoration: underline;
}

.seo-columns {
    display: grid;
    gap: 1.5rem;
}

.seo-columns h3 {
    margin-bottom: 0.5rem;
}

.seo-columns ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--muted);
    display: grid;
    gap: 0.35rem;
}

@media (min-width: 820px) {
    .seo-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .progress-step {
        flex-direction: row;
    }

    .progress-step .step-label {
        font-size: 0.82rem;
    }

    .form-category {
        padding: 1rem;
    }

    .hero-card {
        padding: 1.25rem;
    }
}
