/* Tema del modulo Compro Oro, allineato al form Jotform "Gestione Oro per Compro Oro". */

.co-page {
    --co-ink: #2c3345;
    --co-muted: #57647e;
    --co-border: #b8bdc9;
    --co-line: #d7d8e1;
    --co-line-soft: #e5e7f2;
    --co-blue: #2e69ff;
    --co-blue-soft: #c9d8fe;
    --co-green: #18bd5b;
    --co-red: #dc2626;
    --co-red-bg: #ffeded;
    --co-bg: #f3f3fe;

    min-height: 100vh;
    box-sizing: border-box;
    padding: 40px 16px 72px;
    background: var(--co-bg);
    color: var(--co-ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 16px;
    line-height: normal;
    -webkit-font-smoothing: antialiased;
}

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

.co-brand {
    display: block;
    width: 160px;
    height: 66px;
    object-fit: contain;
    margin: 0 auto 16px;
}

.co-card {
    width: 100%;
    max-width: 752px;
    margin: 0 auto;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 4px rgba(87, 100, 126, 0.21);
}

.co-card-body {
    padding: 0 38px;
}

/* Intestazione della prima pagina */
.co-form-header {
    margin: 0;
    padding: 40px 52px;
    border-bottom: 1px solid var(--co-line);
    text-align: center;
}

.co-form-logo {
    display: block;
    width: 340px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 14px;
}

.co-form-title {
    margin: 0;
    color: var(--co-ink);
    font-size: 32px;
    line-height: 46px;
    font-weight: 600;
    text-align: center;
}

/* Intestazioni di sezione */
.co-section-head {
    margin: 20px -4px 12px;
    padding: 14px;
    border-bottom: 1px solid var(--co-line);
}

.co-section-head h2,
.co-section-head h1 {
    margin: 0 0 4px;
    color: var(--co-ink);
    font-size: 20px;
    line-height: 29px;
    font-weight: 600;
}

.co-section-head p {
    margin: 0;
    color: var(--co-ink);
    font-size: 14px;
    line-height: 22px;
    font-weight: 500;
}

.co-subhead {
    margin: 28px 4px 8px;
    padding: 0 10px 10px;
    border-bottom: 1px solid var(--co-line);
}

.co-subhead h3 {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 29px;
    font-weight: 600;
}

.co-subhead p {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 22px;
    font-weight: 500;
}

.co-text {
    margin: 8px 4px 16px;
    padding: 0 10px;
    font-size: 15px;
    line-height: 24px;
}

.co-text p {
    margin: 0 0 12px;
}

.co-text strong {
    font-weight: 600;
}

.co-intro {
    margin: 16px 4px 8px;
    padding: 0 10px;
    font-size: 16px;
    font-weight: 500;
}

.co-question {
    margin: 28px 14px 10px;
    font-size: 16px;
    font-weight: 500;
}

.co-help--wide {
    width: 200px;
    max-width: none;
}

/* Campi */
.co-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.co-field {
    flex: 1 1 0;
    min-width: 0;
    margin: 12px 4px;
    padding: 0 10px;
    border-radius: 3px;
}

.co-field--fixed {
    flex: 0 1 330px;
}

.co-field--sm {
    flex: 0 0 116px;
}

.co-field--sm .co-error {
    white-space: normal;
    max-width: 100%;
}

.co-field--full {
    flex: 1 1 100%;
}

.co-page .valid.modified:not([type=checkbox]) {
    outline: none;
}

.co-field:has(.invalid) {
    background: var(--co-red-bg);
}

.co-label {
    display: block;
    margin: 0 0 14px 2px;
    color: var(--co-ink);
    font-size: 16px;
    font-weight: 500;
}

.co-req {
    color: #f23a3c;
    margin-left: 2px;
}

.co-input,
.co-select,
.co-textarea {
    display: block;
    width: 100%;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--co-border);
    border-radius: 4px;
    background: #fff;
    color: var(--co-ink);
    font: inherit;
    font-size: 16px;
}

.co-textarea {
    height: auto;
    min-height: 96px;
    padding: 10px;
    resize: vertical;
}

.co-select {
    padding-right: 30px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='10' height='6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 1L5 5 1 1' stroke='%2357647E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    appearance: none;
}

.co-input::placeholder,
.co-textarea::placeholder {
    color: #c3cad8;
    opacity: 1;
}

.co-input:focus,
.co-select:focus,
.co-textarea:focus {
    outline: none;
    border-color: var(--co-blue);
    box-shadow: 0 0 0 1px var(--co-blue-soft);
}

.co-input.invalid,
.co-select.invalid,
.co-textarea.invalid {
    outline: none;
    border-color: #e23a3a;
}

.co-input:disabled,
.co-select:disabled {
    background-color: #f7f7fb;
    color: #8a93a6;
}

.co-help {
    margin: 6px 0 0;
    color: var(--co-muted);
    font-size: 12px;
    line-height: 18px;
}

.co-phone-row {
    display: flex;
    gap: 10px;
}

.co-phone-row .co-field {
    margin: 0;
    padding: 0;
}

.co-phone-prefix {
    flex: 0 0 170px;
}

.co-phone-number {
    flex: 1 1 auto;
}

.co-country-select {
    position: relative;
}

.co-country-label {
    display: block;
    padding: 0 28px 0 34px;
    line-height: 38px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.co-country-flag {
    position: absolute;
    top: 50%;
    left: 8px;
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
    transform: translateY(-50%);
    pointer-events: none;
}

.co-country-native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.co-country-select:focus-within .co-country-label {
    border-color: var(--co-blue);
    box-shadow: 0 0 0 1px var(--co-blue-soft);
}

.co-country-select:has(.invalid) .co-country-label {
    border-color: #e23a3a;
}

/* Pulsanti */
.co-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 20px 0 0;
    padding: 28px 52px;
    border-top: 1px solid var(--co-line-soft);
}

.co-footer--end {
    justify-content: flex-end;
}

.co-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 128px;
    height: 48px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    font: 500 16px 'Inter', Arial, sans-serif;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

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

.co-btn--primary:hover {
    background: #1f5aef;
    border-color: #1f5aef;
    color: #fff;
}

.co-btn--secondary {
    background: var(--co-line-soft);
    border-color: var(--co-line-soft);
    color: var(--co-ink);
}

.co-btn--secondary:hover {
    background: #d9dcea;
    color: var(--co-ink);
}

.co-btn--success {
    min-width: 180px;
    background: var(--co-green);
    border-color: var(--co-green);
    color: #fff;
}

.co-btn--success:hover {
    background: #14a950;
    border-color: #14a950;
    color: #fff;
}

.co-btn--small {
    min-width: 90px;
    height: 40px;
    font-size: 15px;
}

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

/* Avvisi e validazione */
.co-error-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: 4px;
    background: var(--co-red);
    color: #fff;
    font-size: 14px;
    line-height: 20px;
}

.co-error-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    color: var(--co-red);
    font-weight: 600;
}

.co-summary {
    margin: 16px 4px;
    padding: 12px 16px;
    border-radius: 4px;
    background: var(--co-red);
    color: #fff;
    font-size: 14px;
    line-height: 21px;
}

.co-summary ul {
    margin: 0;
    padding-left: 20px;
}

.co-summary p {
    margin: 0 0 6px;
}

.co-error {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 6px 3px 24px;
    border-radius: 4px;
    background-color: var(--co-red);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='14' height='15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='7' cy='7.5' r='6.2' stroke='%23fff' stroke-width='1.4'/%3E%3Cpath d='M7 4v4.2M7 10.8v.2' stroke='%23fff' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 6px center;
    color: #fff;
    font-size: 12px;
    line-height: 15px;
    white-space: nowrap;
}

.co-alert {
    margin: 16px 4px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 21px;
}

.co-alert--danger {
    background: var(--co-red-bg);
    border: 1px solid #f3b6bc;
    color: #9b1c1c;
}

.co-alert--warning {
    background: #fff4d6;
    border: 1px solid #e8c76a;
    color: #7a5a00;
}

.co-alert--info {
    background: #eaf1ff;
    border: 1px solid #b9ccff;
    color: #1f3f91;
}

.co-alert .co-btn {
    margin-left: 12px;
    vertical-align: middle;
}

.co-alert a {
    color: inherit;
    text-decoration: underline;
}

/* Prodotti */
.co-products {
    margin: 4px 4px 8px;
}

.co-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0 4px;
    padding: 12px 0 18px;
    border-bottom: 1px solid #d9dde4;
    font-size: 16px;
    font-weight: 600;
}

.co-category-toggle {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 6L6 1 1 6' stroke='%2357647E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center no-repeat;
}

.co-product {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border-radius: 4px;
}

.co-product.is-selected {
    background: rgba(85, 115, 215, 0.06);
}

.co-product + .co-product {
    border-top: 1px dashed rgba(195, 202, 216, 0.5);
}

.co-check {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: var(--co-blue);
    cursor: pointer;
}

.co-thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border: 1px solid #e6e6e6;
    border-radius: 3px;
    background: #fff;
    object-fit: cover;
}

.co-product-main {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 110px;
}

.co-product-name {
    display: block;
    padding-right: 8px;
    color: var(--co-ink);
    font-size: 16px;
    font-weight: 600;
}

.co-product-desc {
    display: block;
    margin-top: 2px;
    padding-right: 8px;
    color: var(--co-ink);
    font-size: 14px;
    line-height: 20px;
}

.co-product-desc p {
    margin: 0 0 6px;
}

.co-product-price {
    position: absolute;
    top: 0;
    right: 0;
    color: var(--co-ink);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.co-product-qty {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.co-product-qty label {
    margin: 0;
    color: var(--co-muted);
    font-size: 12px;
}

.co-product-qty .co-select {
    width: 68px;
    height: 40px;
    font-size: 16px;
}

/* Convenzione */
.co-coupon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.co-coupon .co-input {
    max-width: 310px;
}

/* Tabelle prezzi */
.co-price-table {
    width: 100%;
    margin: 8px 0 4px;
    border-collapse: collapse;
    font-size: 14px;
}

.co-price-table th,
.co-price-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--co-line-soft);
    text-align: left;
    vertical-align: top;
}

.co-price-table thead th {
    color: var(--co-muted);
    font-size: 12px;
    font-weight: 600;
}

.co-price-table .co-num {
    text-align: right;
    white-space: nowrap;
}

.co-total-lines {
    margin: 12px 0 0;
    padding-top: 8px;
    border-top: 1px solid var(--co-line);
}

.co-total-lines div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 8px;
    font-size: 15px;
}

.co-total-lines strong {
    font-size: 16px;
}

.co-empty {
    margin: 8px 0;
    color: var(--co-muted);
    font-size: 14px;
}

/* Radio della fatturazione elettronica */
.co-radios {
    margin: 8px 4px 16px;
}

.co-radio {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 10px;
    padding: 2px 10px;
    font-size: 16px;
    line-height: 22px;
    cursor: pointer;
}

.co-radio input {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    accent-color: var(--co-blue);
}

.co-radio-body {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 2px 16px;
}

.co-radio-cost {
    color: var(--co-ink);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

/* Checkbox privacy */
.co-check-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 12px 14px 4px;
    font-size: 15px;
    line-height: 22px;
}

.co-check-line input {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    accent-color: var(--co-blue);
}

.co-check-line a {
    color: var(--co-blue);
    text-decoration: underline;
}

/* Riepilogo */
.co-recap {
    margin: 8px 4px 16px;
    padding: 0 10px;
}

.co-recap dl {
    display: grid;
    grid-template-columns: minmax(140px, 200px) 1fr;
    gap: 6px 16px;
    margin: 0;
    font-size: 14px;
    line-height: 21px;
}

.co-recap dt {
    color: var(--co-muted);
    font-weight: 500;
}

.co-recap dd {
    margin: 0;
}

.co-recap .co-recap-actions {
    margin-top: 10px;
    font-size: 14px;
}

.co-recap .co-recap-actions a {
    color: var(--co-blue);
    text-decoration: underline;
}

/* Esito */
.co-success {
    padding: 40px 52px 48px;
    text-align: center;
}

.co-success h2 {
    margin: 0 0 12px;
    color: #12894a;
    font-size: 28px;
    font-weight: 600;
}

.co-success p {
    margin: 0 0 12px;
    font-size: 16px;
    line-height: 24px;
}

.co-success .co-reference {
    font-size: 14px;
    color: var(--co-muted);
}

@media (max-width: 767px) {
    .co-page {
        padding: 24px 16px 48px;
    }

    .co-card-body {
        padding: 0 16px;
    }

    .co-form-header {
        margin: 0;
        padding: 32px 20px;
    }

    .co-form-title {
        max-width: 300px;
        margin: 0 auto;
        font-size: 28px;
        line-height: 40px;
    }

    .co-form-logo {
        width: 300px;
    }

    .co-section-head,
    .co-text,
    .co-recap {
        margin-left: 0;
        margin-right: 0;
    }

    .co-row {
        display: block;
    }

    .co-field,
    .co-field--fixed,
    .co-field--full {
        width: 100%;
        flex: 1 1 100%;
    }

    .co-field--sm {
        width: 116px;
        flex: 0 0 116px;
    }

    .co-phone-row .co-field {
        width: auto;
    }

    .co-phone-prefix {
        flex: 0 0 160px;
    }

    .co-footer {
        margin: 20px 0 0;
        padding: 24px 16px;
    }

    .co-product {
        gap: 12px;
        padding: 16px 8px;
    }

    .co-thumb {
        flex-basis: 56px;
        width: 56px;
        height: 56px;
    }

    .co-product-main {
        padding-right: 0;
    }

    .co-product-price {
        position: static;
        display: block;
        margin-top: 4px;
    }

    .co-price-table {
        display: block;
        overflow-x: auto;
    }

    .co-coupon {
        align-items: stretch;
        flex-direction: column;
    }

    .co-coupon .co-input {
        max-width: none;
    }

    .co-coupon .co-btn {
        width: 100%;
    }

    .co-recap dl {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .co-recap dd {
        margin-bottom: 8px;
    }

    .co-success {
        padding: 32px 20px 40px;
    }

    .co-error {
        white-space: normal;
        max-width: 100%;
    }
}
