/* ============================================================
   Enhanced Payment Receipt & Custom Payment UI
   Shared by: PaymentMethodCustom.aspx, PaymentMethodCustomReceipt.aspx,
              PaymentGatewayReceipt.aspx
   ============================================================ */

/* ---------- Receipt card ---------- */
.tg-receipt-box {
    background: #fff;
    border: 1px solid #e6eaef;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(23, 43, 77, .08);
    padding: 30px 34px !important;
    position: relative;
    overflow: hidden;
}

.tg-receipt-box::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, #2e9e5b, #58c37f, #2e9e5b);
}

.tg-receipt-box.tg-receipt-error::before {
    background: linear-gradient(90deg, #d9534f, #f0827e, #d9534f);
}

.tg-receipt-box h2 {
    font-size: 22px;
    margin: 8px 0 4px;
    color: #1f2d3d;
}

/* ---------- Success header ---------- */
.tg-success-banner {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #f2faf5;
    border: 1px solid #cdeeda;
    border-radius: 10px;
    padding: 18px 20px;
    margin: 14px 0 20px;
    flex-wrap: wrap;
}

.tg-success-check {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #2e9e5b;
    color: #fff !important;
    font-size: 26px;
    line-height: 58px;
    text-align: center;
    box-shadow: 0 0 0 6px rgba(46, 158, 91, .15);
    animation: tgPop .45s cubic-bezier(.18, .89, .32, 1.28);
}

@keyframes tgPop {
    0%   { transform: scale(.3); opacity: 0; }
    100% { transform: scale(1);  opacity: 1; }
}

.tg-success-banner .message { flex: 1 1 260px; }

.tg-success-banner .main-message {
    color: #1e7a45;
    font-size: 19px;
    margin: 0 0 4px;
}

.tg-success-banner p {
    margin: 0;
    color: #4a6357;
}

/* ---------- Detail rows ---------- */
.tg-receipt-box dl.term-description {
    margin: 10px 0 0;
    border: 1px solid #edf1f5;
    border-radius: 8px;
    overflow: hidden;
}

.tg-receipt-box dl.term-description dt,
.tg-receipt-box dl.term-description dd {
    padding: 11px 16px;
    margin: 0;
    border-bottom: 1px solid #edf1f5;
}

.tg-receipt-box dl.term-description dt {
    width: 38%;
    font-weight: 600;
    color: #55677d;
    background: #f8fafc;
    clear: both;
    float: left;
}

.tg-receipt-box dl.term-description dd {
    color: #1f2d3d;
    font-weight: 500;
    overflow: hidden;
}

.tg-receipt-box dl.term-description dt:last-of-type,
.tg-receipt-box dl.term-description dd:last-of-type {
    border-bottom: 0;
}

/* Amount emphasis (first dd after receipt no is total) */
.tg-amount-highlight {
    color: #1e7a45 !important;
    font-size: 17px;
    font-weight: 700 !important;
}

/* ---------- Section titles inside receipt ---------- */
.tg-receipt-box h2 + hr,
.tg-receipt-box hr {
    border-color: #edf1f5;
    margin: 18px 0;
}

/* ---------- Print button ---------- */
.tg-receipt-box .print-button {
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 96, 160, .25);
    transition: transform .15s ease, box-shadow .15s ease;
}

.tg-receipt-box .print-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0, 96, 160, .35);
}

/* ---------- Trust badges footer ---------- */
.tg-trust-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px dashed #dfe6ee;
}

.tg-trust-row img { opacity: .9; }

.tg-secure-note {
    color: #6b7d92;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tg-secure-note .fa-lock { color: #2e9e5b; }

/* ---------- Sidebar help box ---------- */
.tg-help-box {
    border-radius: 12px !important;
    border: 1px solid #e6eaef;
    box-shadow: 0 4px 18px rgba(23, 43, 77, .06);
}

.tg-help-box h4 { margin-top: 0; }

/* ---------- Error view ---------- */
.tg-error-box {
    background: #fff;
    border: 1px solid #f3d6d5;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(120, 30, 30, .08);
    padding: 34px 30px !important;
    text-align: center;
}

.tg-error-box .tg-error-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #d9534f !important;
    color: #fff;
    font-size: 28px;
    line-height: 64px !important;
    display: inline-block;
    text-align: center;
    box-shadow: 0 0 0 8px rgba(217, 83, 79, .12);
    animation: tgPop .45s cubic-bezier(.18, .89, .32, 1.28);
}

.tg-error-box h1 {
    font-size: 26px;
    margin: 16px 0 6px;
    color: #b33b38;
}

/* ---------- Custom payment page ---------- */
.tg-pay-tabs .tabs.full-width li a {
    border-radius: 8px 8px 0 0;
    font-weight: 600;
}

.tg-pay-panel {
    background: #fff;
    border: 1px solid #e6eaef;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 6px 22px rgba(23, 43, 77, .06);
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
    .tg-receipt-box { padding: 20px 16px !important; }

    .tg-receipt-box dl.term-description dt,
    .tg-receipt-box dl.term-description dd {
        width: 100%;
        float: none;
    }

    .tg-receipt-box dl.term-description dt { border-bottom: 0; padding-bottom: 4px; }

    .tg-trust-row { justify-content: center; }
}

/* ---------- Print ---------- */
@media print {
    body * { visibility: hidden; }

    #section-to-print, #section-to-print * { visibility: visible; }

    #section-to-print { position: absolute; left: 0; top: 0; width: 100%; }

    .tg-receipt-box { box-shadow: none; border: 1px solid #ccc; }

    .print-button, .sidebar, .tg-trust-row img { display: none !important; }
}
