.teamhub-quote-app {
    --thq-bg: #f8fbfd;
    --thq-card: #ffffff;
    --thq-border: #d5dee7;
    --thq-primary: #111c6a;
    --thq-primary-dark: #0b1250;
    --thq-accent: #0e766e;
    --thq-accent-dark: #0a5953;
    --thq-text: #0f172a;
    --thq-muted: #475569;
    --thq-danger: #b91c1c;
    --thq-warning: #92400e;
    --thq-focus: #2563eb;
    font-family: "Montserrat", "Avenir Next", "Segoe UI", Arial, sans-serif;
    color: var(--thq-text);
    background: linear-gradient(145deg, #f8fbfd 0%, #eef5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 18px;
    max-width: 980px;
}

.teamhub-quote-app * {
    box-sizing: border-box;
}

.thq-card {
    background: var(--thq-card);
    border: 1px solid var(--thq-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 50px -34px rgba(2, 6, 23, 0.35);
}

.thq-heading {
    margin: 0 0 8px;
    font-size: 1.5rem;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.thq-subheading {
    margin: 0 0 16px;
    color: var(--thq-muted);
}

.thq-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.thq-field label,
.thq-field legend,
.thq-modal-grid label > span {
    display: block;
    font-size: 0.93rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.thq-field input,
.thq-field select,
.thq-modal-grid input,
.thq-modal-grid select,
.thq-modal-grid textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    color: var(--thq-text);
    min-height: 44px;
}

.thq-field input:focus,
.thq-field select:focus,
.thq-modal-grid input:focus,
.thq-modal-grid select:focus,
.thq-modal-grid textarea:focus,
.thq-btn:focus,
.thq-stepper-btn:focus,
.thq-modal-close:focus {
    outline: 3px solid rgba(37, 99, 235, 0.2);
    outline-offset: 1px;
    border-color: var(--thq-focus);
}

.thq-stepper {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    gap: 8px;
}

.thq-stepper-btn {
    border: 1px solid #0f2f8b;
    border-radius: 10px;
    background: linear-gradient(135deg, #2176d8 0%, #1667c7 100%);
    color: #fff;
    font-size: 1.15rem;
    cursor: pointer;
}

.thq-fieldset {
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    padding: 10px;
}

.thq-radio-card {
    display: block;
    border: 1px solid #d6e1ea;
    background: #f8fafc;
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.thq-radio-card:last-child {
    margin-bottom: 0;
}

.thq-radio-card input {
    width: auto;
    min-height: 0;
    margin-right: 8px;
}

.thq-toggle-wrap {
    padding-top: 4px;
}

.thq-check-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    margin: 0;
}

.thq-check-card input {
    width: auto;
    min-height: 0;
    margin: 0;
}

.thq-check-card span {
    font-weight: 600;
}

.thq-check-card.is-disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.thq-check-card.is-disabled input {
    pointer-events: none;
}

.thq-package-note {
    margin: 8px 0 0;
    color: var(--thq-muted);
    font-size: 0.9rem;
}

.thq-warning,
.thq-error,
.thq-submit-error,
.thq-result-email-status {
    min-height: 20px;
    margin: 10px 0 0;
    font-size: 0.92rem;
}

.thq-warning {
    color: var(--thq-warning);
}

.thq-error,
.thq-submit-error {
    color: var(--thq-danger);
}

.thq-summary {
    margin-top: 18px;
    border: 1px solid #dce7f1;
    border-radius: 14px;
    background: #fbfdff;
    padding: 14px;
}

.thq-summary h3 {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.thq-summary-lines {
    list-style: none;
    margin: 0;
    padding: 0;
}

.thq-summary-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px dashed #d7e0ea;
    padding: 8px 0;
}

.thq-summary-line:last-child {
    border-bottom: 0;
}

.thq-summary-line-left {
    display: flex;
    flex-direction: column;
}

.thq-summary-line-label {
    font-weight: 600;
}

.thq-summary-line-details {
    color: var(--thq-muted);
    margin-top: 2px;
}

.thq-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.thq-total-row {
    border-top: 1px solid #d6e2ed;
    padding-top: 10px;
    margin-top: 10px;
    font-size: 1.06rem;
}

.thq-actions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.thq-btn {
    appearance: none;
    border: 1px solid transparent;
    min-height: 44px;
    border-radius: 11px;
    padding: 10px 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.thq-btn-primary {
    background: linear-gradient(135deg, var(--thq-accent) 0%, var(--thq-accent-dark) 100%);
    color: #fff;
    border-color: #0f2f8b;
}

.thq-btn-primary:hover {
    filter: brightness(1.05);
}

.thq-btn-secondary {
    background: #fff;
    border-color: #0f2f8b;
    color: #0f2f8b;
}

.thq-btn-ghost {
    background: linear-gradient(135deg, #2176d8 0%, #1667c7 100%);
    border-color: #0f2f8b;
    color: #fff;
}

.thq-btn.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.thq-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
}

.thq-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.52);
}

.thq-modal-dialog {
    position: relative;
    width: min(92vw, 820px);
    margin: 4vh auto;
    max-height: 92vh;
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #dbe6f0;
    padding: 18px;
    box-shadow: 0 24px 60px -24px rgba(15, 23, 42, 0.5);
}

.thq-modal-close {
    position: absolute;
    right: 10px;
    top: 10px;
    border: 1px solid #0f2f8b;
    background: linear-gradient(135deg, #2176d8 0%, #1667c7 100%);
    color: #fff;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.thq-modal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.thq-hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    pointer-events: none;
}

.thq-consent-wrap {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
}

.thq-consent-wrap input {
    width: auto;
    min-height: 0;
    margin-top: 3px;
}

.thq-captcha-wrap {
    margin-top: 12px;
}

.thq-captcha-wrap .cf-turnstile {
    min-height: 65px;
}

.thq-result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.thq-result-table th,
.thq-result-table td {
    border: 1px solid #d2dee9;
    padding: 8px;
    vertical-align: top;
}

.thq-result-table th {
    background: #f8fafc;
    text-align: left;
}

.thq-result-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.thq-result-head h3 {
    margin: 0;
}

.thq-result-meta {
    margin: 6px 0 0;
}

.thq-result-logo {
    height: 66px;
    max-width: 260px;
    object-fit: contain;
}

.thq-result-disclaimer {
    margin-top: 12px;
    font-size: 0.88rem;
    color: var(--thq-muted);
}

@media (min-width: 768px) {
    .teamhub-quote-app {
        padding: 24px;
    }

    .thq-card {
        padding: 24px;
    }

    .thq-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .thq-fieldset {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        align-items: start;
    }

    .thq-fieldset legend {
        grid-column: 1 / -1;
    }

    .thq-toggle-wrap {
        grid-column: 1 / -1;
    }

    .thq-modal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .thq-modal-grid label:last-child {
        grid-column: 1 / -1;
    }

    .thq-result-logo {
        height: 78px;
    }
}

@media print {
    .teamhub-quote-app {
        background: #fff;
        border: 0;
        padding: 0;
    }

    .thq-actions,
    .thq-modal,
    .thq-warning,
    .thq-error {
        display: none !important;
    }

    .thq-card,
    .thq-summary {
        box-shadow: none;
        border-color: #000;
    }
}
