/* ==================================================================
   PayModal — reusable payment modal styles.
   Loaded on every page that uses window.PayModal (assets/js/pay-modal.js).
   ================================================================== */

.pm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .60);
    z-index: 10500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    animation: pmFade .18s ease;
}
.pm-overlay.open { display: flex; }
@keyframes pmFade { from { opacity: 0 } to { opacity: 1 } }

.pm-card {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 460px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px -10px rgba(0, 0, 0, .35);
    animation: pmSlideUp .24s cubic-bezier(.16, .9, .5, 1);
    position: relative;
    font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
    color: #0f172a;
}
@keyframes pmSlideUp { from { transform: translateY(24px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

.pm-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: 0;
    cursor: pointer;
    color: #94a3b8;
    font-size: 28px;
    line-height: 1;
    padding: 0 6px;
    z-index: 2;
    transition: color .15s ease;
}
.pm-close:hover { color: #ef4444; }

.pm-head {
    text-align: center;
    padding: 22px 22px 12px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid #f1f5f9;
}
.pm-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    margin: 0 auto 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #2563eb, #16a34a);
    color: #fff;
    font-size: 22px;
    box-shadow: 0 8px 22px -6px rgba(37, 99, 235, .40);
}
.pm-head h3 { margin: 0 0 4px; font-size: 17px; font-weight: 800; letter-spacing: -.3px; color: #0f172a; }
.pm-sub { margin: 0; font-size: 12.5px; color: #475569; line-height: 1.5; }

.pm-summary {
    padding: 14px 22px;
    background: #fff;
    border-bottom: 1px dashed #e2e8f0;
}
.pm-line.discount { color: #16a34a; }
.pm-line.discount b { color: #16a34a; font-weight: 800; }

/* Coupon input row */
.pm-coupon {
    display: flex;
    gap: 6px;
    padding: 12px 22px;
    background: #f8fafc;
    border-bottom: 1px dashed #e2e8f0;
}
.pm-coupon input {
    flex: 1;
    padding: 9px 11px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Menlo','Consolas',monospace;
    text-transform: uppercase;
    letter-spacing: .5px;
    background: #fff;
    outline: none;
    color: #0f172a;
    transition: border-color .15s ease;
}
.pm-coupon input:focus { border-color: #2563eb; }
.pm-coupon-btn {
    padding: 0 14px;
    border: 1.5px solid #16a34a;
    background: #f0fdf4;
    color: #16a34a;
    font-weight: 800;
    font-size: 12px;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: .3px;
    text-transform: uppercase;
    transition: background .15s ease;
}
.pm-coupon-btn:hover  { background: #dcfce7; }
.pm-coupon-btn.active { background: #16a34a; color: #fff; }
.pm-coupon-msg {
    padding: 0 22px 8px;
    font-size: 12px;
    color: #64748b;
    display: none;
}
.pm-coupon-msg.err { display: block; color: #b91c1c; }
.pm-coupon-msg.ok  { display: block; color: #16a34a; }
.pm-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
    color: #475569;
}
.pm-line b { color: #0f172a; font-weight: 700; }
.pm-line.total {
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid #e2e8f0;
    font-size: 15px;
    color: #0f172a;
}
.pm-line.total b { font-size: 18px; color: #16a34a; font-weight: 800; }

.pm-body {
    padding: 14px 22px 8px;
}

.pm-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}
.pm-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 11px 8px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
    text-align: center;
}
.pm-method:hover { background: #fff; border-color: #cbd5e1; }
.pm-method input { display: none; }
.pm-method input:checked + .p-name { color: #0f172a !important; }
.pm-method:has(input:checked) {
    background: #eff6ff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}
.pm-method .p-name { font-size: 13.5px; font-weight: 800; letter-spacing: -.2px; }
.pm-method .p-hint { font-size: 10.5px; color: #64748b; font-weight: 500; }

.pm-field { margin-bottom: 12px; }
.pm-field label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.pm-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    font-size: 13.5px;
    color: #0f172a;
    background: #fff;
    outline: none;
    font-family: inherit;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.pm-field input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.pm-banner {
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 12.5px;
    margin: 4px 0 12px;
    border: 1px solid;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.pm-banner.success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.pm-banner.error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.pm-banner.info    { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.pm-banner small { display: block; opacity: .8; margin-top: 3px; font-family: 'Menlo', monospace; font-size: 11px; }

.pm-actions {
    display: flex;
    gap: 8px;
    padding: 12px 22px 18px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    border-radius: 0 0 16px 16px;
}
.pm-btn {
    flex: 1;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #334155;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.pm-btn:hover  { background: #f1f5f9; }
.pm-btn:active { transform: translateY(1px); }
.pm-btn.ghost { background: #fff; }
.pm-btn.primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 14px -6px rgba(37, 99, 235, .55);
}
.pm-btn.primary:hover { background: linear-gradient(135deg, #1d4ed8, #1e40af); }
.pm-btn:disabled { opacity: .7; cursor: not-allowed; }

@media (max-width: 500px) {
    .pm-methods { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .pm-head { padding: 18px 18px 10px; }
    .pm-body { padding: 12px 18px 6px; }
    .pm-summary { padding: 12px 18px; }
    .pm-actions { padding: 10px 18px 14px; }
}
