/* ==========================================================================
   House Innovation — Form "Diventa Fornitore"
   Design System + Component Styles
   Mobile-first, CSS Custom Properties, Accessibility
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens (Custom Properties)
   -------------------------------------------------------------------------- */

:root {
    /* Brand colors */
    --hi-primary: #1a5632;
    --hi-primary-light: #238244;
    --hi-primary-dark: #0e3a20;
    --hi-primary-alpha: rgba(26, 86, 50, 0.12);
    --hi-secondary: #f5a623;

    /* Neutral */
    --hi-bg: #f5f7fa;
    --hi-bg-card: #ffffff;
    --hi-text: #1d2327;
    --hi-text-light: #646970;
    --hi-text-muted: #8c8f94;
    --hi-border: #dcdde1;
    --hi-border-light: #e9ecef;

    /* Feedback */
    --hi-error: #d63638;
    --hi-error-bg: #fcf0f1;
    --hi-error-border: #f0b8b8;
    --hi-success: #00a32a;
    --hi-success-bg: #edfaef;
    --hi-success-border: #b8e6bf;
    --hi-info: #2271b1;
    --hi-info-bg: #f0f6fc;

    /* Typography */
    --hi-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --hi-fs-xs: 0.75rem;
    --hi-fs-sm: 0.875rem;
    --hi-fs-base: 1rem;
    --hi-fs-lg: 1.125rem;
    --hi-fs-xl: 1.375rem;
    --hi-fs-2xl: 1.75rem;
    --hi-fw-normal: 400;
    --hi-fw-medium: 500;
    --hi-fw-semibold: 600;
    --hi-fw-bold: 700;
    --hi-lh: 1.5;

    /* Spacing */
    --hi-sp-2xs: 0.25rem;
    --hi-sp-xs: 0.5rem;
    --hi-sp-sm: 0.75rem;
    --hi-sp-md: 1rem;
    --hi-sp-lg: 1.5rem;
    --hi-sp-xl: 2rem;
    --hi-sp-2xl: 2.5rem;
    --hi-sp-3xl: 3rem;

    /* Layout */
    --hi-form-max-w: 820px;
    --hi-radius: 6px;
    --hi-radius-lg: 10px;
    --hi-radius-xl: 14px;
    --hi-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --hi-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --hi-shadow-lg: 0 4px 20px rgba(0,0,0,0.10);

    /* Transitions */
    --hi-tr-fast: 150ms ease;
    --hi-tr: 250ms ease;
    --hi-tr-slow: 400ms ease-in-out;
}

/* --------------------------------------------------------------------------
   2. Base / Container
   -------------------------------------------------------------------------- */

.hi-form-container {
    max-width: var(--hi-form-max-w);
    margin: 0 auto;
    padding: var(--hi-sp-lg) var(--hi-sp-md);
    font-family: var(--hi-font);
    font-size: var(--hi-fs-base);
    line-height: var(--hi-lh);
    color: var(--hi-text);
    -webkit-font-smoothing: antialiased;
}

.hi-form-container *,
.hi-form-container *::before,
.hi-form-container *::after {
    box-sizing: border-box;
}

/* Ensure [hidden] always wins over component display rules */
.hi-form-container [hidden] {
    display: none !important;
}

/* --------------------------------------------------------------------------
   3. Progress Bar
   -------------------------------------------------------------------------- */

.hi-progress {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    margin-bottom: var(--hi-sp-2xl);
    padding: 0;
    gap: 0;
}

.hi-progress__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    width: 80px;
    cursor: default;
    position: relative;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}

.hi-progress__step--clickable {
    cursor: pointer;
}

.hi-progress__circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--hi-fs-sm);
    font-weight: var(--hi-fw-bold);
    background: var(--hi-bg);
    border: 2px solid var(--hi-border);
    color: var(--hi-text-muted);
    transition: all var(--hi-tr);
    position: relative;
}

.hi-progress__check {
    display: none;
}

.hi-progress__label {
    display: block;
    margin-top: var(--hi-sp-xs);
    font-size: var(--hi-fs-xs);
    font-weight: var(--hi-fw-medium);
    color: var(--hi-text-muted);
    text-align: center;
    transition: color var(--hi-tr);
    line-height: 1.3;
}

/* Active step */
.hi-progress__step--active .hi-progress__circle {
    background: var(--hi-primary);
    border-color: var(--hi-primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--hi-primary-alpha);
    transform: scale(1.08);
}

.hi-progress__step--active .hi-progress__label {
    color: var(--hi-primary);
    font-weight: var(--hi-fw-semibold);
}

/* Completed step */
.hi-progress__step--completed .hi-progress__circle {
    background: var(--hi-success);
    border-color: var(--hi-success);
    color: #fff;
}

.hi-progress__step--completed .hi-progress__number {
    display: none;
}

.hi-progress__step--completed .hi-progress__check {
    display: inline;
    font-size: var(--hi-fs-lg);
}

.hi-progress__step--completed .hi-progress__label {
    color: var(--hi-success);
}

/* Line between steps */
.hi-progress__line {
    flex: 1;
    height: 3px;
    background: var(--hi-border-light);
    margin-top: 19px;
    z-index: 1;
    transition: background var(--hi-tr);
    min-width: 20px;
}

.hi-progress__line--filled {
    background: var(--hi-success);
}

/* --------------------------------------------------------------------------
   4. Steps
   -------------------------------------------------------------------------- */

.hi-step {
    display: none;
    animation: hiFadeIn var(--hi-tr) ease forwards;
}

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

.hi-step[hidden] {
    display: none;
}

.hi-step__title {
    font-size: var(--hi-fs-2xl);
    font-weight: var(--hi-fw-bold);
    color: var(--hi-primary-dark);
    margin: 0 0 var(--hi-sp-xs);
    padding: 0;
}

.hi-step__description {
    color: var(--hi-text-light);
    margin: 0 0 var(--hi-sp-xl);
}

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

/* --------------------------------------------------------------------------
   5. Cards (group containers)
   -------------------------------------------------------------------------- */

.hi-card {
    background: var(--hi-bg-card);
    border: 1px solid var(--hi-border-light);
    border-radius: var(--hi-radius-xl);
    padding: var(--hi-sp-lg);
    margin-bottom: var(--hi-sp-lg);
    box-shadow: var(--hi-shadow-sm);
}

.hi-card__title {
    font-size: var(--hi-fs-lg);
    font-weight: var(--hi-fw-semibold);
    color: var(--hi-primary);
    margin: 0 0 var(--hi-sp-md);
    padding-bottom: var(--hi-sp-xs);
    border-bottom: 2px solid var(--hi-primary);
}

.hi-card__description {
    color: var(--hi-text-light);
    font-size: var(--hi-fs-sm);
    margin: 0 0 var(--hi-sp-md);
}

/* --------------------------------------------------------------------------
   6. Form Grid
   -------------------------------------------------------------------------- */

.hi-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--hi-sp-sm) var(--hi-sp-md);
}

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

/* --------------------------------------------------------------------------
   7. Fields
   -------------------------------------------------------------------------- */

.hi-field {
    margin-bottom: var(--hi-sp-2xs);
}

/* Label */
.hi-field__label {
    display: flex;
    align-items: center;
    gap: var(--hi-sp-2xs);
    font-size: var(--hi-fs-sm);
    font-weight: var(--hi-fw-medium);
    color: var(--hi-text);
    margin-bottom: var(--hi-sp-2xs);
    line-height: 1.4;
}

.hi-field__label--required::after {
    content: "*";
    color: var(--hi-error);
    font-weight: var(--hi-fw-bold);
    margin-left: 2px;
}

/* Input / Select / Textarea */
.hi-field__input {
    display: block;
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 2px solid var(--hi-border);
    border-radius: var(--hi-radius);
    font-family: var(--hi-font);
    font-size: var(--hi-fs-base);
    color: var(--hi-text);
    background: var(--hi-bg-card);
    transition: border-color var(--hi-tr-fast), box-shadow var(--hi-tr-fast);
    outline: none;
    appearance: none;
}

.hi-field__input::placeholder {
    color: var(--hi-text-muted);
}

.hi-field__input:focus,
.hi-field__input:focus-visible {
    border-color: var(--hi-primary);
    box-shadow: 0 0 0 3px var(--hi-primary-alpha);
}

/* Select arrow */
.hi-field__select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23646970' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.5rem;
}

/* Textarea */
.hi-field__textarea {
    resize: vertical;
    min-height: 100px;
}

.hi-field__counter {
    display: block;
    text-align: right;
    font-size: var(--hi-fs-xs);
    color: var(--hi-text-muted);
    margin-top: var(--hi-sp-2xs);
}

/* Error state */
.hi-field--error .hi-field__input {
    border-color: var(--hi-error);
    box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.12);
}

.hi-field__error {
    display: none;
    font-size: var(--hi-fs-sm);
    color: var(--hi-error);
    margin-top: var(--hi-sp-2xs);
    line-height: 1.3;
}

.hi-field--error .hi-field__error {
    display: block;
}

/* --------------------------------------------------------------------------
   8. Radio Buttons
   -------------------------------------------------------------------------- */

.hi-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--hi-sp-sm) var(--hi-sp-lg);
    padding-top: var(--hi-sp-2xs);
}

.hi-radio-group--inline {
    flex-direction: row;
}

.hi-radio {
    display: flex;
    align-items: center;
    gap: var(--hi-sp-xs);
    cursor: pointer;
    font-size: var(--hi-fs-base);
    position: relative;
    user-select: none;
}

.hi-radio__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.hi-radio__mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 2px solid var(--hi-border);
    border-radius: 50%;
    flex-shrink: 0;
    transition: all var(--hi-tr-fast);
    background: var(--hi-bg-card);
}

.hi-radio__mark::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--hi-primary);
    transform: scale(0);
    transition: transform var(--hi-tr-fast);
}

.hi-radio__input:checked + .hi-radio__mark {
    border-color: var(--hi-primary);
}

.hi-radio__input:checked + .hi-radio__mark::after {
    transform: scale(1);
}

.hi-radio__input:focus-visible + .hi-radio__mark {
    box-shadow: 0 0 0 3px var(--hi-primary-alpha);
}

.hi-radio__label {
    font-size: var(--hi-fs-sm);
    color: var(--hi-text);
}

/* --------------------------------------------------------------------------
   9. Checkboxes
   -------------------------------------------------------------------------- */

.hi-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--hi-sp-sm);
    padding-top: var(--hi-sp-2xs);
}

.hi-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--hi-sp-xs);
    cursor: pointer;
    font-size: var(--hi-fs-base);
    position: relative;
    user-select: none;
}

.hi-checkbox__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.hi-checkbox__mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 2px solid var(--hi-border);
    border-radius: var(--hi-radius);
    flex-shrink: 0;
    transition: all var(--hi-tr-fast);
    background: var(--hi-bg-card);
    margin-top: 1px;
}

.hi-checkbox__mark::after {
    content: "✓";
    font-size: 14px;
    color: #fff;
    opacity: 0;
    transform: scale(0);
    transition: all var(--hi-tr-fast);
}

.hi-checkbox__input:checked + .hi-checkbox__mark {
    background: var(--hi-primary);
    border-color: var(--hi-primary);
}

.hi-checkbox__input:checked + .hi-checkbox__mark::after {
    opacity: 1;
    transform: scale(1);
}

.hi-checkbox__input:focus-visible + .hi-checkbox__mark {
    box-shadow: 0 0 0 3px var(--hi-primary-alpha);
}

.hi-checkbox__label {
    font-size: var(--hi-fs-sm);
    color: var(--hi-text);
    line-height: 1.5;
}

/* Privacy checkbox (larger label) */
.hi-checkbox--privacy .hi-checkbox__label {
    font-size: var(--hi-fs-sm);
    color: var(--hi-text-light);
}

/* --------------------------------------------------------------------------
   10. Tooltip
   -------------------------------------------------------------------------- */

.hi-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.hi-tooltip__icon {
    font-size: var(--hi-fs-base);
    color: var(--hi-text-muted);
    line-height: 1;
    transition: color var(--hi-tr-fast);
}

.hi-tooltip:hover .hi-tooltip__icon,
.hi-tooltip:focus .hi-tooltip__icon {
    color: var(--hi-primary);
}

.hi-tooltip__content {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.92);
    opacity: 0;
    pointer-events: none;
    background: var(--hi-text);
    color: #fff;
    padding: var(--hi-sp-xs) var(--hi-sp-sm);
    border-radius: var(--hi-radius);
    font-size: var(--hi-fs-xs);
    font-weight: var(--hi-fw-normal);
    line-height: 1.4;
    white-space: nowrap;
    max-width: 280px;
    white-space: normal;
    z-index: 100;
    transition: opacity var(--hi-tr-fast), transform var(--hi-tr-fast);
}

.hi-tooltip__content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--hi-text);
}

.hi-tooltip:hover .hi-tooltip__content,
.hi-tooltip:focus-within .hi-tooltip__content {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    pointer-events: auto;
}

/* --------------------------------------------------------------------------
   11. Certification Accordion (Step 3)
   -------------------------------------------------------------------------- */

.hi-cert-group {
    padding: var(--hi-sp-md) 0;
    border-bottom: 1px solid var(--hi-border-light);
}

.hi-cert-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hi-cert-group:first-child {
    padding-top: 0;
}

.hi-cert-question {
    margin-bottom: 0;
}

.hi-cert-accordion {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height var(--hi-tr-slow), opacity var(--hi-tr), padding var(--hi-tr);
    background: var(--hi-bg);
    border-radius: var(--hi-radius-lg);
    margin-top: 0;
    padding: 0 var(--hi-sp-md);
}

.hi-cert-accordion--open {
    opacity: 1;
    padding: var(--hi-sp-md);
    margin-top: var(--hi-sp-sm);
    border: 1px dashed var(--hi-border);
}

.hi-cert-accordion__intro {
    font-size: var(--hi-fs-sm);
    color: var(--hi-text-light);
    font-style: italic;
    margin: 0 0 var(--hi-sp-md);
    padding-bottom: var(--hi-sp-sm);
    border-bottom: 1px solid var(--hi-border-light);
}

.hi-cert-accordion__fields {
    margin-bottom: var(--hi-sp-md);
}

.hi-cert-accordion__questions {
    display: flex;
    flex-direction: column;
    gap: var(--hi-sp-sm);
}

.hi-sub-question {
    padding: var(--hi-sp-sm);
    border-radius: var(--hi-radius);
    background: var(--hi-bg-card);
    border: 1px solid var(--hi-border-light);
}

.hi-sub-question .hi-field__label {
    font-size: var(--hi-fs-sm);
    margin-bottom: var(--hi-sp-xs);
}

/* --------------------------------------------------------------------------
   12. Navigation Buttons
   -------------------------------------------------------------------------- */

.hi-nav {
    display: flex;
    align-items: center;
    gap: var(--hi-sp-sm);
    margin-top: var(--hi-sp-xl);
    padding-top: var(--hi-sp-lg);
    border-top: 1px solid var(--hi-border-light);
}

.hi-nav__spacer {
    flex: 1;
}

.hi-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--hi-sp-xs);
    padding: 0.7rem 1.6rem;
    border: 2px solid transparent;
    border-radius: var(--hi-radius-lg);
    font-family: var(--hi-font);
    font-size: var(--hi-fs-base);
    font-weight: var(--hi-fw-semibold);
    cursor: pointer;
    transition: all var(--hi-tr-fast);
    text-decoration: none;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
}

.hi-btn:focus-visible {
    outline: 2px solid var(--hi-primary);
    outline-offset: 2px;
}

.hi-btn--sm {
    padding: 0.45rem 1rem;
    font-size: var(--hi-fs-sm);
}

.hi-btn--primary {
    background: var(--hi-primary);
    color: #fff;
    border-color: var(--hi-primary);
}

.hi-btn--primary:hover {
    background: var(--hi-primary-dark);
    border-color: var(--hi-primary-dark);
}

.hi-btn--primary:disabled {
    background: var(--hi-border);
    border-color: var(--hi-border);
    color: var(--hi-text-muted);
    cursor: not-allowed;
}

.hi-btn--outline {
    background: transparent;
    color: var(--hi-text-light);
    border-color: var(--hi-border);
}

.hi-btn--outline:hover {
    border-color: var(--hi-text-light);
    color: var(--hi-text);
}

.hi-btn--success {
    background: var(--hi-success);
    color: #fff;
    border-color: var(--hi-success);
}

.hi-btn--success:hover {
    background: #008a20;
    border-color: #008a20;
}

.hi-btn--success:disabled {
    background: var(--hi-border);
    border-color: var(--hi-border);
    color: var(--hi-text-muted);
    cursor: not-allowed;
}

.hi-btn--link {
    background: none;
    border: none;
    color: var(--hi-primary);
    padding: var(--hi-sp-2xs) var(--hi-sp-xs);
    font-size: var(--hi-fs-sm);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hi-btn--link:hover {
    color: var(--hi-primary-dark);
}

/* --------------------------------------------------------------------------
   13. Summary Cards (Step 5)
   -------------------------------------------------------------------------- */

.hi-summary-card {
    background: var(--hi-bg-card);
    border: 1px solid var(--hi-border-light);
    border-radius: var(--hi-radius-xl);
    margin-bottom: var(--hi-sp-md);
    overflow: hidden;
    box-shadow: var(--hi-shadow-sm);
}

.hi-summary-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--hi-sp-sm) var(--hi-sp-lg);
    background: var(--hi-bg);
    border-bottom: 1px solid var(--hi-border-light);
}

.hi-summary-card__title {
    font-size: var(--hi-fs-base);
    font-weight: var(--hi-fw-semibold);
    color: var(--hi-primary);
    margin: 0;
}

.hi-summary-card__body {
    padding: var(--hi-sp-md) var(--hi-sp-lg);
}

.hi-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--hi-sp-xs) var(--hi-sp-md);
}

.hi-summary-item {
    padding: var(--hi-sp-2xs) 0;
}

.hi-summary-item__label {
    font-size: var(--hi-fs-xs);
    font-weight: var(--hi-fw-semibold);
    color: var(--hi-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 1px;
}

.hi-summary-item__value {
    font-size: var(--hi-fs-sm);
    color: var(--hi-text);
}

.hi-summary-item__value--empty {
    color: var(--hi-text-muted);
    font-style: italic;
}

/* --------------------------------------------------------------------------
   14. Draft Restore Banner
   -------------------------------------------------------------------------- */

.hi-draft-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--hi-sp-sm);
    padding: var(--hi-sp-sm) var(--hi-sp-md);
    background: var(--hi-info-bg);
    border: 1px solid var(--hi-info);
    border-radius: var(--hi-radius-lg);
    margin-bottom: var(--hi-sp-lg);
}

.hi-draft-banner[hidden] {
    display: none;
}

.hi-draft-banner p {
    margin: 0;
    font-size: var(--hi-fs-sm);
    font-weight: var(--hi-fw-medium);
    color: var(--hi-info);
}

.hi-draft-banner__actions {
    display: flex;
    gap: var(--hi-sp-xs);
}

/* --------------------------------------------------------------------------
   15. Success Message
   -------------------------------------------------------------------------- */

.hi-success-message {
    text-align: center;
    padding: var(--hi-sp-3xl) var(--hi-sp-xl);
}

.hi-success-message[hidden] {
    display: none;
}

.hi-success-message__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--hi-success-bg);
    color: var(--hi-success);
    font-size: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--hi-sp-lg);
    border: 3px solid var(--hi-success-border);
}

.hi-success-message h2 {
    font-size: var(--hi-fs-xl);
    font-weight: var(--hi-fw-bold);
    color: var(--hi-text);
    margin: 0 0 var(--hi-sp-xs);
}

.hi-success-message p {
    color: var(--hi-text-light);
    margin: 0;
}

/* --------------------------------------------------------------------------
   16. Loading Spinner (submit)
   -------------------------------------------------------------------------- */

.hi-btn--loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.hi-btn--loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hiSpin 0.6s linear infinite;
}

@keyframes hiSpin {
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   17. Responsive — Mobile (max 767px)
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
    .hi-form-container {
        padding: var(--hi-sp-md) var(--hi-sp-sm);
    }

    /* Progress bar: compact on mobile */
    .hi-progress {
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: var(--hi-sp-xs);
    }

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

    .hi-progress__step {
        width: 56px;
        min-width: 56px;
    }

    .hi-progress__circle {
        width: 32px;
        height: 32px;
        font-size: var(--hi-fs-xs);
    }

    .hi-progress__label {
        font-size: 0.65rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 56px;
    }

    .hi-progress__line {
        margin-top: 15px;
        min-width: 12px;
    }

    /* Step titles */
    .hi-step__title {
        font-size: var(--hi-fs-xl);
    }

    /* Cards: less padding */
    .hi-card {
        padding: var(--hi-sp-md);
        border-radius: var(--hi-radius-lg);
    }

    .hi-card__title {
        font-size: var(--hi-fs-base);
    }

    /* Nav buttons: full width on small screens */
    .hi-nav {
        flex-wrap: wrap;
        gap: var(--hi-sp-xs);
    }

    .hi-nav__spacer {
        display: none;
    }

    .hi-nav .hi-btn {
        flex: 1 1 auto;
        min-width: 0;
        justify-content: center;
    }

    /* Summary cards */
    .hi-summary-card__header {
        padding: var(--hi-sp-xs) var(--hi-sp-md);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--hi-sp-2xs);
    }

    .hi-summary-card__body {
        padding: var(--hi-sp-sm) var(--hi-sp-md);
    }

    /* Tooltip: left-aligned on mobile to avoid overflow */
    .hi-tooltip__content {
        left: 0;
        transform: translateX(0) scale(0.92);
        max-width: 220px;
    }

    .hi-tooltip:hover .hi-tooltip__content,
    .hi-tooltip:focus-within .hi-tooltip__content {
        transform: translateX(0) scale(1);
    }

    .hi-tooltip__content::after {
        left: 12px;
        transform: none;
    }

    /* Radio/Checkbox groups: vertical on mobile */
    .hi-radio-group {
        flex-direction: column;
        gap: var(--hi-sp-xs);
    }

    /* Cert accordion */
    .hi-cert-accordion--open {
        padding: var(--hi-sp-sm);
    }

    /* Draft banner: stack vertically */
    .hi-draft-banner {
        flex-direction: column;
        text-align: center;
    }
}

/* --------------------------------------------------------------------------
   17b. Responsive — Tablet+ (768px)
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {
    .hi-form-container {
        padding: var(--hi-sp-2xl) var(--hi-sp-lg);
    }

    .hi-form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hi-progress__step {
        width: auto;
        min-width: 90px;
    }

    .hi-progress__label {
        font-size: var(--hi-fs-sm);
    }

    .hi-card {
        padding: var(--hi-sp-xl);
    }

    .hi-summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hi-cert-accordion__fields {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--hi-sp-sm) var(--hi-sp-md);
    }
}

/* --------------------------------------------------------------------------
   18. Accessibility
   -------------------------------------------------------------------------- */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hi-form-container *,
    .hi-form-container *::before,
    .hi-form-container *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .hi-cert-accordion {
        transition: none;
    }
}

/* Focus visible — keyboard only */
.hi-field__input:focus:not(:focus-visible) {
    box-shadow: none;
    border-color: var(--hi-border);
}

.hi-field__input:focus-visible {
    border-color: var(--hi-primary);
    box-shadow: 0 0 0 3px var(--hi-primary-alpha);
}

/* Screen-reader only */
.hi-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast */
@media (forced-colors: active) {
    .hi-radio__mark,
    .hi-checkbox__mark {
        forced-color-adjust: none;
    }

    .hi-btn {
        border: 2px solid ButtonText;
    }

    .hi-progress__circle {
        border: 2px solid ButtonText;
    }
}
