/* ============================================================
   Checkout restyle — hero, stepper, sidebar, CTA
   Usato da: shop/checkout/index e shop/checkout/completa-pagamento
   ============================================================ */

/* Scrollbar sempre presente: evita differenze di larghezza viewport
   tra pagine lunghe (con scroll) e corte (senza scroll) */
html { overflow-y: scroll; }

/* HERO ---------------------------------------------------- */
.checkout-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 40px 0 30px;
    overflow: hidden;
}
.checkout-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10,30,50,.85) 0, rgba(10,30,50,.4) 60%, transparent 100%);
    z-index: 0;
}
.checkout-hero > .container { position: relative; z-index: 1; }
.checkout-hero .back-link {
    display: inline-flex; align-items: center; gap: 8px;
    color: rgba(255,255,255,.85); text-decoration: none;
    font-size: 14px; margin-bottom: 14px;
    transition: color .2s;
}
.checkout-hero .back-link:hover { color: #fff; }
.checkout-hero h1 {
    font-size: 28px; font-weight: 700;
    margin: 0 0 6px; color: #fff;
    line-height: 1.2;
}
.checkout-hero .checkout-hero-corso {
    font-size: 16px; opacity: .9; margin: 0;
}

/* STEPPER ------------------------------------------------- */
.checkout-stepper {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 22px 0;
}
.checkout-stepper-list {
    display: flex; align-items: center; justify-content: center;
    list-style: none; padding: 0; margin: 0;
    max-width: 600px; margin-inline: auto;
}
.checkout-stepper-item {
    display: flex; flex-direction: column; align-items: center;
    flex: 1; position: relative; text-align: center;
}
.checkout-stepper-item + .checkout-stepper-item::before {
    content: '';
    position: absolute;
    top: 16px; left: -50%;
    width: 100%; height: 2px;
    background: #e0e0e0;
    z-index: 0;
}
.checkout-stepper-item.done + .checkout-stepper-item::before,
.checkout-stepper-item.active + .checkout-stepper-item.done::before,
.checkout-stepper-item.done + .checkout-stepper-item.active::before {
    background: #2980b9;
}
.checkout-stepper-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #d0d6db;
    color: #98a3ac;
    font-size: 14px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 1;
    transition: all .2s;
}
.checkout-stepper-label {
    margin-top: 8px;
    font-size: 13px; color: #98a3ac;
    font-weight: 500;
}
.checkout-stepper-item.active .checkout-stepper-circle {
    background: #2980b9;
    border-color: #2980b9;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(41,128,185,.15);
}
.checkout-stepper-item.active .checkout-stepper-label {
    color: #1a3a5c; font-weight: 700;
}
.checkout-stepper-item.done .checkout-stepper-circle {
    background: #27ae60;
    border-color: #27ae60;
    color: #fff;
}
.checkout-stepper-item.done .checkout-stepper-circle::before {
    content: '\f00c'; /* fa-check */
    font-family: FontAwesome;
}
.checkout-stepper-item.done .checkout-stepper-circle .step-num { display: none; }
.checkout-stepper-item.done .checkout-stepper-label { color: #27ae60; }
.checkout-stepper-item.error .checkout-stepper-circle {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(231,76,60,.15);
}
.checkout-stepper-item.error .checkout-stepper-circle::before {
    content: '\f00d'; /* fa-times */
    font-family: FontAwesome;
}
.checkout-stepper-item.error .checkout-stepper-circle .step-num { display: none; }
.checkout-stepper-item.error .checkout-stepper-label { color: #c0392b; font-weight: 700; }

/* FORM MODERNO dentro checkout-layout: occupa tutta la larghezza */
.checkout-layout .form-moderno-container {
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Allinea i btn Bootstrap dentro form-moderno al blu Formacenter */
.form-moderno .btn.btn-primary,
.firma-modal .btn.btn-primary {
    background-color: #2695da;
    border-color: #2695da;
    color: #fff;
}
.form-moderno .btn.btn-primary:hover,
.form-moderno .btn.btn-primary:focus,
.firma-modal .btn.btn-primary:hover,
.firma-modal .btn.btn-primary:focus {
    background-color: #1a7ab8;
    border-color: #1a7ab8;
    color: #fff;
}
.form-moderno .btn.btn-primary:disabled,
.firma-modal .btn.btn-primary:disabled {
    background-color: #2695da;
    border-color: #2695da;
    opacity: .55;
}

/* STATUS BLOCK (errore, conferma) ----------------------- */
.checkout-status-block {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
    padding: 20px 0;
}
.checkout-status-block .checkout-status-message {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 28px;
}
.checkout-cta-large {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    box-sizing: border-box;
    background: #2980b9;
    color: #fff;
    padding: 15px 36px;
    border-radius: 8px;
    font-size: 16px; font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    text-shadow: none;
    border: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    transition: background-color .15s ease;
}
.checkout-cta-large:hover,
.checkout-cta-large:focus {
    background: #2471a3;
    color: #fff;
    text-decoration: none;
}
.checkout-cta-large.danger { background: #e74c3c; }
.checkout-cta-large.danger:hover,
.checkout-cta-large.danger:focus { background: #d44233; }
.checkout-status-help {
    margin: 22px 0 0;
    font-size: 14px;
    color: #6b7680;
}
.checkout-status-help a {
    color: #2980b9; font-weight: 600;
    text-decoration: none;
}
.checkout-status-help a:hover { text-decoration: underline; }
.checkout-status-help .sep {
    display: inline-block; margin: 0 8px;
    color: #c5ccd2;
}

/* SUCCESS / ERROR ICONS ---------------------------------- */
.checkout-status-icon {
    width: 84px; height: 84px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
    font-size: 38px; color: #fff;
}
.checkout-status-icon.success { background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%); box-shadow: 0 6px 16px rgba(39,174,96,.3); }
.checkout-status-icon.warning { background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%); box-shadow: 0 6px 16px rgba(230,126,34,.3); }
.checkout-status-icon.error { background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); box-shadow: 0 6px 16px rgba(192,57,43,.3); }
.checkout-status-icon i { margin: 0; }

.checkout-status-title {
    font-size: 28px; font-weight: 700;
    color: #1a3a5c; text-align: center; margin: 0 0 8px;
}
.checkout-status-subtitle {
    font-size: 16px; color: #6b7680;
    text-align: center; margin: 0 0 28px;
}

/* RIEPILOGO LARGO (conferma/dettaglio) ------------------- */
.checkout-recap-card {
    background: #fff;
    border: 1px solid #e6e9ec;
    border-radius: 8px;
    padding: 22px 24px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,.03);
}
.checkout-recap-card h4 {
    font-size: 16px; font-weight: 700;
    color: #1a3a5c;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef1f3;
}
.checkout-recap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 24px;
}
.checkout-recap-item .recap-label {
    font-size: 12px; color: #98a3ac;
    text-transform: uppercase; letter-spacing: .3px;
    margin-bottom: 4px;
}
.checkout-recap-item .recap-value {
    font-size: 15px; color: #1a3a5c;
    font-weight: 600;
}
@media (max-width: 575px) {
    .checkout-recap-grid { grid-template-columns: 1fr; }
}

/* BONIFICO DETAILS --------------------------------------- */
.checkout-bonifico-card {
    background: #fff;
    border: 1px solid #e6e9ec;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,.03);
}
.checkout-bonifico-card.ecampus { border-left: 4px solid #0056b3; }
.checkout-bonifico-card.formacenter { border-left: 4px solid #27ae60; }
.checkout-bonifico-header {
    background: #f7f9fb;
    padding: 14px 22px;
    display: flex; align-items: center; gap: 10px;
    font-size: 16px; font-weight: 700;
    color: #1a3a5c;
    border-bottom: 1px solid #eef1f3;
}
.checkout-bonifico-header .badge-num {
    background: #2980b9; color: #fff;
    width: 26px; height: 26px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px;
}
.checkout-bonifico-card.formacenter .checkout-bonifico-header .badge-num { background: #27ae60; }
.checkout-bonifico-print {
    margin-left: auto;
    background: transparent;
    border: 1px solid #d0d6db;
    color: #1a3a5c;
    width: 36px; height: 36px;
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background-color .15s, border-color .15s, color .15s;
}
.checkout-bonifico-print:hover {
    background: #fff;
    border-color: #2980b9;
    color: #2980b9;
}
.checkout-bonifico-print i { margin: 0; }
.checkout-bonifico-body { padding: 18px 22px; }
.checkout-bonifico-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eef1f3;
    font-size: 14px;
}
.checkout-bonifico-row:last-child { border-bottom: 0; }
.checkout-bonifico-row .label { color: #6b7680; font-weight: 600; }
.checkout-bonifico-row .value {
    color: #1a3a5c; font-weight: 600;
    font-family: 'Courier New', monospace;
    text-align: right;
}
.checkout-bonifico-row .value.amount { font-size: 16px; color: #27ae60; }

/* NOTICE BOX --------------------------------------------- */
.checkout-notice {
    background: #fff8e1;
    border-left: 4px solid #f39c12;
    padding: 14px 18px;
    border-radius: 4px;
    margin-bottom: 18px;
}
.checkout-notice h5 {
    margin: 0 0 6px;
    font-size: 15px; font-weight: 700;
    color: #7a5d00;
    display: flex; align-items: center; gap: 8px;
}
.checkout-notice p {
    margin: 0; color: #6b5400;
    font-size: 14px; line-height: 1.5;
}

/* ACTION BUTTONS ----------------------------------------- */
.checkout-actions {
    display: flex; gap: 10px; flex-wrap: wrap;
    margin-top: 24px;
}
.checkout-actions .btn-action {
    flex: 1; min-width: 200px;
    box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 22px;
    border-radius: 8px;
    font-size: 15px; font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    text-shadow: none;
    line-height: 1.2;
    border: 1px solid transparent;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.checkout-actions .btn-action:focus,
.checkout-actions .btn-action:focus-visible {
    outline: 2px solid rgba(41,128,185,.4);
    outline-offset: 2px;
}
.checkout-actions .btn-action.primary {
    background-color: #2980b9;
    color: #fff;
}
.checkout-actions .btn-action.primary:hover,
.checkout-actions .btn-action.primary:focus {
    background-color: #2471a3;
    color: #fff;
    text-decoration: none;
}
.checkout-actions .btn-action.secondary {
    background-color: #fff;
    color: #1a3a5c;
    border-color: #d0d6db;
}
.checkout-actions .btn-action.secondary:hover,
.checkout-actions .btn-action.secondary:focus {
    background-color: #f7f9fb;
    border-color: #2980b9;
    color: #2980b9;
    text-decoration: none;
}
.checkout-actions .btn-action.danger {
    background-color: #e74c3c;
    color: #fff;
}
.checkout-actions .btn-action.danger:hover,
.checkout-actions .btn-action.danger:focus {
    background-color: #d44233;
    color: #fff;
    text-decoration: none;
}

/* LAYOUT WRAPPER ----------------------------------------- */
.checkout-layout {
    background: #f7f9fb;
    padding: 32px 0 60px;
    min-height: 60vh;
}
.checkout-content-narrow {
    max-width: 760px;
    margin: 0 auto;
}
.checkout-content-wide {
    max-width: 900px;
    margin: 0 auto;
}
/* h4 di default nel checkout-layout (overridato dentro .checkout-form-card) */
.checkout-layout > .container > h4,
.checkout-layout .checkout-recap-card h4 {
    font-size: 17px; font-weight: 700;
    color: #1a3a5c; margin: 0 0 14px;
}
.checkout-form-card {
    background: #fff;
    border: 1px solid #eef1f3;
    border-radius: 12px;
    padding: 32px 36px;
    margin-bottom: 22px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.checkout-form-card h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1a3a5c;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef1f3;
    display: flex; align-items: center; gap: 10px;
}
.checkout-form-card h4 i { color: #2980b9; }
@media (max-width: 575px) {
    .checkout-form-card { padding: 22px 20px; }
}

/* SIDEBAR ------------------------------------------------- */
.checkout-sidebar {
    background: #fff;
    border: 1px solid #e6e9ec;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    position: sticky;
    top: 20px;
}
.checkout-sidebar-image {
    width: 100%; height: 140px;
    background-size: cover; background-position: center;
    position: relative;
}
.checkout-sidebar-image::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.6) 100%);
}
.checkout-sidebar-body { padding: 20px; }
.checkout-sidebar-eyebrow {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
    color: #2980b9; margin-bottom: 6px;
}
.checkout-sidebar-title {
    font-size: 15px; font-weight: 700;
    margin: 0 0 14px; color: #1a3a5c;
    line-height: 1.3;
}
.checkout-sidebar-meta {
    list-style: none; padding: 0;
    margin: 0 0 16px;
    border-top: 1px solid #eef1f3;
}
.checkout-sidebar-meta li {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid #eef1f3;
    font-size: 13px; color: #444;
}
.checkout-sidebar-meta li i {
    color: #2980b9; width: 18px; text-align: center;
}

/* RIEPILOGO PREZZO ---------------------------------------- */
.checkout-price-box {
    background: #f7f9fb;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.checkout-price-row {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 14px; color: #555;
    padding: 3px 0;
}
.checkout-price-row.discount { color: #27ae60; font-weight: 600; }
.checkout-price-row.total {
    margin-top: 8px; padding-top: 12px;
    border-top: 1px solid #e6e9ec;
    font-size: 16px; color: #1a3a5c;
}
.checkout-price-row.total .price-value {
    font-size: 24px; font-weight: 800;
    color: #1a3a5c;
}

/* COUPON -------------------------------------------------- */
.checkout-coupon {
    margin-bottom: 14px;
}
.checkout-coupon-header {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; color: #555;
    cursor: pointer;
    padding: 8px 0;
}
.checkout-coupon-header .toggle-icon { transition: transform .2s; color: #98a3ac; }
.checkout-coupon-header.open .toggle-icon { transform: rotate(180deg); }
.checkout-coupon-body {
    display: none; padding-top: 8px;
}
.checkout-coupon-body.open { display: block; }
.checkout-coupon-form {
    display: flex; gap: 6px;
}
.checkout-coupon-form input {
    flex: 1;
    border: 1px solid #d0d6db;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 13px;
}
.checkout-coupon-form button {
    background: #2980b9;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 14px;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
}
.checkout-coupon-form button:disabled {
    background: #d0d6db; cursor: not-allowed;
}
.checkout-coupon-form button.remove { background: #c0392b; }
.checkout-coupon-applied {
    display: flex; justify-content: space-between; align-items: center;
    background: #e8f7ee; color: #1e7d3f;
    padding: 8px 10px; border-radius: 4px;
    font-size: 13px; font-weight: 600;
}
.checkout-coupon-applied .fa-tag { margin-right: 6px; }
.checkout-coupon-applied a {
    color: #c0392b; font-size: 12px;
    text-decoration: none;
}

/* HELP BOX ----------------------------------------------- */
.checkout-sidebar-help {
    background: #f7f9fb;
    border-radius: 6px; padding: 14px;
    text-align: center; margin-top: 14px;
}
.checkout-sidebar-help-title {
    font-size: 12px; font-weight: 700;
    color: #1a3a5c; margin: 0 0 8px;
    text-transform: uppercase; letter-spacing: .3px;
}
.checkout-sidebar-help a {
    display: block; padding: 5px;
    font-size: 13px; color: #2980b9;
    text-decoration: none; font-weight: 600;
}
.checkout-sidebar-help a:hover { color: #1a3a5c; }

/* CTA BUTTON --------------------------------------------- */
.checkout-cta-wrapper { margin-top: 24px; }
.checkout-cta {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-size: 17px; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(39,174,96,.3);
    transition: all .2s;
}
.checkout-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(39,174,96,.4);
}
.checkout-cta .price-tag {
    background: rgba(255,255,255,.2);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 16px;
}
.checkout-cta-trust {
    display: flex; justify-content: center; gap: 16px; flex-wrap: wrap;
    margin-top: 12px;
    font-size: 12px; color: #6b7680;
}
.checkout-cta-trust span {
    display: inline-flex; align-items: center; gap: 5px;
}
.checkout-cta-trust i { color: #27ae60; }

/* MOBILE -------------------------------------------------- */
@media (max-width: 991px) {
    .checkout-hero { padding: 30px 0 22px; }
    .checkout-hero h1 { font-size: 22px; }
    .checkout-hero .checkout-hero-corso { font-size: 14px; }
    .checkout-stepper { padding: 16px 0; }
    .checkout-stepper-label { font-size: 11px; }
    .checkout-sidebar { position: static; margin-bottom: 20px; }
    .checkout-layout { padding: 20px 0 40px; }
    .checkout-form-card { padding: 16px; }
}
