/*
 * Pagamenti online: foglio globale intenzionale.
 * Non usare CSS isolation per questo componente: la repository e compilata sia
 * da macOS sia da Windows e gli artefatti Razor condivisi possono disallineare
 * l'identificatore di scope tra assembly e bundle CSS.
 */
.mp-shell {
    max-width: 1500px;
    margin: 0 auto;
    padding: 6px 0 50px;
    color: #172033;
}

.mp-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    border-radius: 24px;
    background: linear-gradient(135deg, #10263f, #174f68 58%, #168a80);
    color: white;
    box-shadow: 0 22px 55px rgba(15, 39, 65, .18);
}

.mp-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: #8ff0d7;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .14em;
}

.mp-hero h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.25rem); }
.mp-hero p { margin: 8px 0 0; color: #d7e8ef; }
.mp-owner-reference { display: block; margin-top: 10px; color: #a9cbd4; }
.mp-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.mp-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.mp-summary article {
    padding: 18px 20px;
    border: 1px solid #dce6ec;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(16, 38, 63, .06);
}

.mp-summary span { display: block; color: #637486; font-size: .84rem; }
.mp-summary strong { display: block; margin-top: 5px; color: #123b52; font-size: 1.7rem; }

.mp-panel {
    margin-top: 18px;
    padding: 24px;
    border: 1px solid #dfe8ed;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 15px 40px rgba(16, 38, 63, .06);
}

.mp-panel-heading,
.mp-editor-title,
.mp-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mp-panel-heading > div { display: flex; align-items: center; gap: 12px; }
.mp-panel-heading > div > span {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: #e0f7f2;
    color: #08766e;
    font-size: .78rem;
    font-weight: 800;
}

.mp-panel-heading h2,
.mp-editor-title h3,
.mp-entity-card h3,
.mp-shop-card h3,
.mp-account-card h3 { margin: 0; }
.mp-panel-heading p { max-width: 520px; margin: 0; color: #667789; font-size: .9rem; }

.mp-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.mp-entity-card {
    padding: 18px;
    border: 1px solid #e1e9ee;
    border-radius: 16px;
    background: #fbfdfe;
}

.mp-entity-card small { color: #08766e; font-weight: 800; }
.mp-entity-card h3 { margin-top: 3px; font-size: 1.05rem; }
.mp-entity-card p { margin: 5px 0 0; color: #6b7885; }
.mp-entity-card dl { display: grid; gap: 7px; margin: 16px 0; }
.mp-entity-card dl div { display: grid; grid-template-columns: 65px 1fr; gap: 8px; }
.mp-entity-card dt { color: #738292; font-size: .78rem; }
.mp-entity-card dd { margin: 0; font-size: .86rem; }

.mp-button,
.mp-link-button {
    border: none;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.mp-button {
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 11px;
    background: #0b8178;
    color: white;
}

.mp-button.secondary { border: 1px solid #cfdde4; background: #fff; color: #23465b; }
.mp-hero .mp-button.secondary { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.1); color: white; }
.mp-hero .mp-button.light { background: #fff; color: #123b52; }
.mp-button.primary-action { min-height: 46px; padding-inline: 22px; }
.mp-button.compact { min-height: 34px; padding: 6px 11px; font-size: .82rem; }
.mp-button:is(a) { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.mp-button:disabled, .mp-link-button:disabled { cursor: not-allowed; opacity: .5; }
.mp-link-button { padding: 0; background: transparent; color: #08766e; }
.mp-link-button.warning { color: #9a6700; }
.mp-link-button.danger { color: #b42318; }

.mp-editor {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #bfe2dc;
    border-radius: 18px;
    background: #f4fbfa;
}

.mp-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
    margin-top: 16px;
}

.mp-form-grid .wide { grid-column: span 2; }
.mp-editor-actions { display: flex; gap: 10px; margin-top: 17px; }

.mp-shell label > span,
.mp-operation-select > span,
.mp-shop-select > span {
    display: block;
    margin-bottom: 5px;
    color: #4e6071;
    font-size: .78rem;
    font-weight: 700;
}

.mp-shell input:not([type="checkbox"]):not([type="radio"]),
.mp-shell select {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #ccd9df;
    border-radius: 9px;
    background: #fff;
    color: #172033;
}

.mp-shell input:focus,
.mp-shell select:focus { outline: 3px solid rgba(11, 129, 120, .13); border-color: #0b8178; }

.mp-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.mp-shop-card {
    padding: 19px;
    border: 1px solid #dfe8ed;
    border-radius: 17px;
    background: linear-gradient(145deg, #fff, #f8fbfc);
}

.mp-shop-card.missing { border-color: #ebc896; background: #fffaf2; }
.mp-shop-card .mp-card-top small { color: #08766e; font-size: .7rem; font-weight: 900; letter-spacing: .1em; }
.mp-shop-card h3 { margin-top: 4px; color: #15384d; font-size: 1.12rem; }
.mp-legal-name { margin: 12px 0 0; color: #566979; font-weight: 700; }
.mp-shop-card dl { display: grid; gap: 9px; margin: 16px 0 10px; }
.mp-shop-card dl div { display: grid; grid-template-columns: 88px 1fr; gap: 10px; }
.mp-shop-card dt { color: #738292; font-size: .76rem; }
.mp-shop-card dd { margin: 0; overflow-wrap: anywhere; font-size: .86rem; }
.mp-tech-reference { display: block; margin-top: 14px; color: #84919c; font-size: .7rem; }

.mp-account-setup {
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(320px, 1fr) auto;
    gap: 18px;
    align-items: end;
    margin-top: 18px;
    padding: 20px;
    border: 1px solid #cbe3df;
    border-radius: 17px;
    background: #f5fbfa;
}

.mp-field > span,
.mp-provider-picker legend,
.mp-operation-select legend,
.mp-shop-select legend {
    margin-bottom: 8px;
    color: #4e6071;
    font-size: .78rem;
    font-weight: 800;
}

.mp-provider-picker,
.mp-operation-select,
.mp-shop-select {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.mp-provider-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.mp-provider-picker legend { grid-column: 1 / -1; }
.mp-provider-choice {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 9px;
    align-items: center;
    min-height: 60px;
    padding: 10px 12px;
    border: 2px solid #d7e1e6;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}
.mp-provider-choice:has(input:checked) { border-color: #0b8178; box-shadow: 0 0 0 3px rgba(11,129,120,.1); }
.mp-provider-choice input { grid-row: 1 / 3; }
.mp-provider-choice strong { color: #213a4b; }
.mp-provider-choice small { color: #738292; font-size: .72rem; }

.mp-table-wrap { margin-top: 18px; overflow-x: auto; }
.mp-table { width: 100%; border-collapse: collapse; }
.mp-table th { padding: 10px; border-bottom: 1px solid #d9e4e9; color: #657586; font-size: .76rem; text-align: left; text-transform: uppercase; }
.mp-table td { padding: 12px 10px; border-bottom: 1px solid #edf1f3; vertical-align: middle; }
.mp-table td small { display: block; margin-top: 3px; color: #738292; }

.mp-inline-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    border-radius: 15px;
    background: #f5f8fa;
}
.mp-inline-form label { min-width: 180px; }
.mp-inline-form .grow { flex: 1; }

.mp-account-list { display: grid; gap: 12px; margin-top: 18px; }
.mp-account-card {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 17px;
    border: 1px solid #dfe8ed;
    border-radius: 16px;
}
.mp-provider { display: grid; place-items: center; min-height: 58px; border-radius: 13px; color: white; font-size: .8rem; font-weight: 900; letter-spacing: .05em; background: #475569; }
.mp-provider.stripe { background: #635bff; }
.mp-provider.sumup { background: #101820; }
.mp-account-main p { margin: 5px 0 8px; color: #6c7c8c; }
.mp-help-text { display: block; margin-top: 9px; color: #657586; line-height: 1.45; }
.mp-account-name { max-width: 420px; font-weight: 800; }
.mp-account-flags { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.mp-account-flags > span:not(.mp-status) { padding: 4px 8px; border-radius: 999px; font-size: .72rem; }
.flag-on { background: #e0f5e9; color: #176b3a; }
.flag-off { background: #f2f4f5; color: #6d7882; }
.mp-account-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 220px; }
.mp-account-actions small { color: #7b8792; font-size: .72rem; text-align: right; }
.mp-connection-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e8eef1;
}
.mp-connection-options small { flex-basis: 100%; color: #657586; line-height: 1.4; }
.mp-provider-unavailable {
    display: block;
    margin-top: 12px;
    padding: 9px 11px;
    border-radius: 9px;
    background: #fff7e8;
    color: #815c16;
    line-height: 1.4;
}

.mp-route-editor {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(260px, 1.2fr) auto;
    gap: 16px;
    align-items: end;
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #cae3df;
    border-radius: 16px;
    background: #f5fbfa;
}
.mp-operation-select label,
.mp-shop-select label { display: inline-flex; align-items: center; gap: 9px; margin: 3px 12px 3px 0; font-size: .86rem; }
.mp-operation-select label > span,
.mp-shop-select label > span { margin: 0; }
.mp-operation-select label strong,
.mp-shop-select label strong { display: block; color: #274456; }
.mp-operation-select label small,
.mp-shop-select label small { display: block; margin-top: 2px; color: #75838e; font-weight: 400; }
.mp-operation { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.mp-operation.order { background: #e0efff; color: #14548a; }
.mp-operation.reservation { background: #f0e8ff; color: #6a37a3; }

.mp-status { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.mp-status.on { background: #dff7e8; color: #176b3a; }
.mp-status.pending { background: #fff1c9; color: #8a5b00; }
.mp-status.warning { background: #ffe6cc; color: #9a4d00; }
.mp-status.off { background: #edf0f2; color: #68747e; }

.mp-note,
.mp-message,
.mp-empty,
.mp-state {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 13px;
}
.mp-note { border: 1px solid #b9dbed; background: #edf8ff; color: #24566f; }
.mp-note.readonly { border-color: #e6d8ad; background: #fff9e8; color: #735d17; }
.mp-message.success { border: 1px solid #b9e3ca; background: #edfaf2; color: #176b3a; }
.mp-message.error, .mp-state-error { border: 1px solid #f2c1bc; background: #fff1ef; color: #9f2b22; }
.mp-empty { border: 1px dashed #ccd8df; background: #f8fafb; color: #697887; text-align: center; }
.mp-empty.warning { border-color: #e8c991; background: #fff9ee; color: #805c18; }
.mp-warning { display: block; margin-top: 10px; color: #9a4d00; }
.mp-subtitle { margin: 25px 0 0; color: #29495c; font-size: 1rem; }

.mp-audit-list { display: grid; gap: 10px; margin-top: 18px; }
.mp-audit-list article { display: grid; grid-template-columns: 150px 1fr auto; gap: 14px; padding: 12px 14px; border: 1px solid #e2e9ed; border-radius: 12px; }
.mp-audit-list time { color: #667789; font-size: .8rem; }
.mp-audit-list div span { display: block; margin-top: 3px; color: #74818d; font-size: .78rem; }
.mp-audit-list p { margin: 0; color: #5f6d79; font-size: .82rem; }

.mp-spinner { display: inline-block; width: 18px; height: 18px; margin-right: 8px; border: 2px solid #c4d6df; border-top-color: #0b8178; border-radius: 50%; animation: mp-spin .8s linear infinite; vertical-align: middle; }
@keyframes mp-spin { to { transform: rotate(360deg); } }

@media (max-width: 1000px) {
    .mp-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mp-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mp-route-editor { grid-template-columns: 1fr 1fr; }
    .mp-account-setup { grid-template-columns: 1fr 1fr; }
    .mp-account-setup .primary-action { grid-column: 1 / -1; }
    .mp-account-card { grid-template-columns: 75px 1fr; }
    .mp-account-actions { grid-column: 1 / -1; flex-direction: row; align-items: center; max-width: none; }
}

@media (max-width: 700px) {
    .mp-hero, .mp-panel-heading, .mp-inline-form { flex-direction: column; align-items: stretch; }
    .mp-hero { padding: 22px; }
    .mp-hero-actions .mp-button { flex: 1; }
    .mp-summary { grid-template-columns: 1fr 1fr; }
    .mp-panel { padding: 17px; border-radius: 18px; }
    .mp-panel-heading > div { align-items: flex-start; }
    .mp-panel-heading p { margin-left: 48px; }
    .mp-form-grid, .mp-route-editor, .mp-account-setup { grid-template-columns: 1fr; }
    .mp-account-setup .primary-action { grid-column: auto; }
    .mp-provider-picker { grid-template-columns: 1fr; }
    .mp-provider-picker legend { grid-column: auto; }
    .mp-form-grid .wide { grid-column: auto; }
    .mp-inline-form label { min-width: 0; }
    .mp-account-card { grid-template-columns: 1fr; align-items: stretch; }
    .mp-provider { min-height: 42px; }
    .mp-account-actions { flex-wrap: wrap; align-items: flex-start; }
    .mp-audit-list article { grid-template-columns: 1fr; gap: 5px; }
}
