/*
 * Shared frontend UI base for EUA v2 checkout forms.
 * This file is intentionally backward-compatible: legacy product classes
 * remain valid aliases while newer neutral classes can be introduced gradually.
 */

:where(.eua-form) {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

:where(.eua-form *),
:where(.eua-form *::before),
:where(.eua-form *::after),
:where(.eua-checkout *),
:where(.eua-checkout *::before),
:where(.eua-checkout *::after),
:where(.eua-gc-wizard *),
:where(.eua-gc-wizard *::before),
:where(.eua-gc-wizard *::after) {
    box-sizing: border-box;
}

:where(.eua-form--epolicy),
:where(.eua-form--dcv),
:where(.eua-form--tourism),
:where(.eua-form--greencard),
:where(.eua-epolicy-form),
:where(.eua-dcv-form),
:where(.eua-tourism-form) {
    width: 100%;
    max-width: 100%;
}

:where(.eua-checkout),
:where(.eua-gc-wizard) {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    width: 100%;
    max-width: 100%;
}

:where(.eua-checkout__sidebar),
:where(.eua-gc-wizard__sidebar) {
    min-width: 0;
}

:where(.eua-checkout__main),
:where(.eua-gc-wizard__main) {
    min-width: 0;
}

:where(.eua-form-grid),
:where(.eua-gc-grid),
:where(.eua-egreencard-grid),
:where(.eua-tourism-grid) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

:where(.eua-form-grid--address),
:where(.eua-gc-address-grid) {
    display: grid;
    grid-template-columns: 40% 20% 20% 20%;
    gap: 16px;
    align-items: end;
}

:where(.eua-field),
:where(.eua-egreencard-field),
:where(.eua-tourism-field) {
    min-width: 0;
    margin: 0;
}

:where(.eua-field__label),
:where(.eua-field label),
:where(.eua-egreencard-field label),
:where(.eua-tourism-field label),
:where(.eua-gc-step label) {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

:where(.eua-field__control),
:where(.eua-field input),
:where(.eua-field select),
:where(.eua-field textarea),
:where(.eua-egreencard-field input),
:where(.eua-egreencard-field select),
:where(.eua-egreencard-field textarea),
:where(.eua-tourism-field input),
:where(.eua-tourism-field select),
:where(.eua-tourism-field textarea),
:where(.eua-gc-step input),
:where(.eua-gc-step select),
:where(.eua-gc-step textarea) {
    width: 100%;
    max-width: 100%;
}

:where(.eua-field__error) {
    margin-top: 6px;
    color: #b42318;
    font-size: 13px;
}

:where(.eua-field-invalid) {
    border-color: #b42318 !important;
    outline-color: #b42318;
}

:where(.eua-actions),
:where(.eua-gc-actions),
:where(.eua-egreencard-calculator-actions),
:where(.eua-tourism-actions) {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

:where(.eua-button),
:where(.eua-gc-primary),
:where(.eua-gc-secondary),
:where(.eua-gc-reset),
:where(.eua-egreencard-buy),
:where(.eua-tourism-v2-buy) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    gap: 8px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
}

:where(.eua-button--primary),
:where(.eua-gc-primary) {
    font-weight: 700;
}

:where(.eua-button--secondary),
:where(.eua-gc-secondary),
:where(.eua-button--ghost),
:where(.eua-gc-reset) {
    font-weight: 600;
}

:where(.eua-steps),
:where(.eua-gc-steps) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

:where(.eua-step),
:where(.eua-gc-step) {
    min-width: 0;
}

:where(.eua-step.is-active),
:where(.eua-gc-step.is-active),
:where(.eua-step.is-complete),
:where(.eua-gc-step.is-complete) {
    visibility: visible;
}

:where(.eua-summary),
:where(.eua-gc-summary) {
    margin: 0;
}

:where(.eua-summary dt),
:where(.eua-gc-summary dt) {
    font-weight: 600;
}

:where(.eua-summary dd),
:where(.eua-gc-summary dd) {
    margin-left: 0;
    overflow-wrap: anywhere;
}

:where(.eua-status),
:where(.eua-gc-status),
:where(.eua-egreencard-calculator-status) {
    min-height: 1px;
}

:where(.eua-alert),
:where(.eua-gc-warning) {
    margin: 12px 0;
}

:where(.eua-alert--error),
:where(.eua-status.is-error),
:where(.eua-gc-status.is-error) {
    color: #7a271a;
}

:where(.eua-alert--success),
:where(.eua-status.is-success),
:where(.eua-gc-status.is-success) {
    color: #1b5e20;
}

:where(.eua-alert--warning),
:where(.eua-gc-warning) {
    color: #7a4b00;
}

:where(.eua-policy-card),
:where(.eua-egreencard-policy-card),
:where(.eua-tourism-policy-card),
:where(.eua-egreencard-tariff-card),
:where(.eua-tariff-card) {
    min-width: 0;
}

:where(.eua-policy-card__brand),
:where(.eua-egreencard-policy-card__brand),
:where(.eua-tourism-policy-card__brand),
:where(.eua-egreencard-tariff-card-header) {
    min-width: 0;
}

:where(.eua-policy-card__info),
:where(.eua-egreencard-policy-card__info),
:where(.eua-tourism-policy-card__info),
:where(.eua-tariff-card__body) {
    min-width: 0;
}

:where(.eua-policy-card__price),
:where(.eua-egreencard-policy-card__price),
:where(.eua-tourism-policy-card__price),
:where(.eua-tariff-card__price) {
    min-width: 0;
}

:where(.eua-policy-card__details),
:where(.eua-egreencard-policy-card__details),
:where(.eua-tourism-policy-card__details) {
    min-width: 0;
}

:where(.eua-policy-card.is-selected),
:where(.eua-egreencard-policy-card.is-selected),
:where(.eua-tourism-policy-card.is-selected),
:where(.eua-egreencard-tariff-card.is-selected),
:where(.eua-tariff-card.is-selected) {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

:where(.eua-loading),
:where(.is-loading) {
    cursor: progress;
}

:where(.is-disabled),
:where([disabled]) {
    cursor: not-allowed;
}

@media (max-width: 768px) {
    :where(.eua-checkout),
    :where(.eua-gc-wizard) {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    :where(.eua-form-grid),
    :where(.eua-form-grid--address),
    :where(.eua-gc-grid),
    :where(.eua-gc-address-grid),
    :where(.eua-egreencard-grid),
    :where(.eua-tourism-grid) {
        grid-template-columns: 1fr;
    }

    :where(.eua-actions),
    :where(.eua-gc-actions),
    :where(.eua-egreencard-calculator-actions),
    :where(.eua-tourism-actions) {
        align-items: stretch;
    }

    :where(.eua-actions > *),
    :where(.eua-gc-actions > *),
    :where(.eua-egreencard-calculator-actions > *),
    :where(.eua-tourism-actions > *) {
        flex: 1 1 180px;
    }

    :where(.eua-button),
    :where(.eua-gc-primary),
    :where(.eua-gc-secondary),
    :where(.eua-gc-reset),
    :where(.eua-egreencard-buy),
    :where(.eua-tourism-v2-buy) {
        width: 100%;
        min-height: 48px;
    }

    :where(.eua-policy-card),
    :where(.eua-egreencard-policy-card),
    :where(.eua-tourism-policy-card),
    :where(.eua-egreencard-tariff-card),
    :where(.eua-tariff-card) {
        touch-action: manipulation;
    }
}
