/* ============================================================
   SanmolApps Pay — Modern fintech theme
   Customer payment pages + Admin portal
   Built on Bootstrap 5.3; this layer restyles, never breaks.
   ============================================================ */

:root {
    --pay-primary: #4f46e5;          /* indigo */
    --pay-primary-600: #4338ca;
    --pay-primary-700: #3730a3;
    --pay-accent: #ff6a00;           /* Sanmol orange */
    --pay-success: #16a34a;
    --pay-success-600: #15803d;
    --pay-ink: #1e293b;              /* slate-800 */
    --pay-muted: #64748b;            /* slate-500 */
    --pay-line: #e2e8f0;             /* slate-200 */
    --pay-bg-1: #eef2ff;             /* indigo-50 */
    --pay-bg-2: #f8fafc;             /* slate-50 */
    --pay-card-radius: 18px;
    --pay-shadow: 0 10px 30px -12px rgba(30, 41, 59, .25), 0 2px 6px -2px rgba(30, 41, 59, .08);
    --pay-shadow-sm: 0 1px 2px rgba(30, 41, 59, .06), 0 1px 3px rgba(30, 41, 59, .08);
}

/* === Base === */
html, body { height: 100%; }
body {
    font-family: 'Inter', 'Open Sans', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--pay-ink);
    font-size: 16px;
    line-height: 1.55;
    background: radial-gradient(1200px 600px at 50% -10%, var(--pay-bg-1) 0%, var(--pay-bg-2) 55%, #fff 100%) fixed;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { font-weight: 700; letter-spacing: -0.01em; color: var(--pay-ink); }
/* Page-level heading + vendor name sit directly on the client's body
   background (outside the white card). Inherit the body text colour so they
   match each client's BodyCss (e.g. white on a branded background) instead of
   being forced dark. In-card headings keep --pay-ink via the rule above. */
.container > h1,
.container > h2,
.container > .text-center > h3 { color: inherit; }
a { color: var(--pay-primary); text-decoration: none; }
a:hover { color: var(--pay-primary-700); }
.text-muted { color: var(--pay-muted) !important; }

/* === Footer ===
   Self-contained "frosted pill" so it stays legible on ANY client BodyCss
   background (blue, dark, image, or the light admin gradient). It no longer
   inherits/contrasts against the body colour. */
.app-footer {
    background: transparent !important;
    border-top: 0 !important;
    padding: 1.1rem 1rem 1.6rem;
    margin-top: 1.5rem;
}
.app-footer small {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem 1.15rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(226, 232, 240, .9);
    box-shadow: 0 6px 18px -8px rgba(15, 23, 42, .35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #475569;
    font-size: .82rem;
    font-weight: 500;
}
.sanmol-brand { color: var(--pay-accent); font-weight: 700; }
.sanmol-brand:hover { color: #e85d00; }

/* === Required field marker === */
.required label:after { color: #ef4444; content: ' *'; display: inline; }

/* === Cards (payment + admin) === */
.card {
    border: 1px solid var(--pay-line);
    border-radius: var(--pay-card-radius);
    box-shadow: var(--pay-shadow);
    background: #fff;
}
.card-body { padding: 1.75rem; }
.pay-card { max-width: 980px; margin: 0 auto; }

/* === Logo === */
.pay-logo { max-height: 84px; width: auto; }

/* === Headings on payment page === */
.pay-card .step-content h4,
.step-content h4 {
    margin-bottom: 1.25rem; padding-bottom: .6rem;
    border-bottom: 1px solid var(--pay-line);
    font-size: 1.15rem; font-weight: 700;
}
.step-content { padding-top: .5rem; }

/* === Step wizard === */
.step-wizard { margin-bottom: 1.75rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--pay-line); }
.step-wizard .step { position: relative; }
/* connector line behind the circles */
.step-wizard .step::before {
    content: ""; position: absolute; top: 21px; left: -50%; width: 100%; height: 3px;
    background: var(--pay-line); z-index: 0; border-radius: 3px;
}
.step-wizard .step:first-child::before { display: none; }
.circle {
    position: relative; z-index: 1;
    width: 44px; height: 44px; line-height: 44px; border-radius: 50%;
    margin: 0 auto 8px; color: #fff; font-weight: 700; font-size: 16px;
    box-shadow: 0 4px 10px -3px rgba(79, 70, 229, .5);
    transition: transform .15s ease, box-shadow .15s ease;
}
.step small { color: var(--pay-muted); font-weight: 600; }
.bg-primary-step { background: linear-gradient(135deg, var(--pay-primary) 0%, var(--pay-primary-700) 100%); }
.bg-default-step { background: #cbd5e1; box-shadow: none; }

/* === Form controls === */
.form-label { font-weight: 600; color: #334155; margin-bottom: .35rem; font-size: .92rem; }
.form-control, .form-select {
    border: 1px solid var(--pay-line);
    border-radius: 11px;
    padding: .62rem .85rem;
    font-size: .97rem;
    background-color: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--pay-primary);
    box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .18);
}
.form-control::placeholder { color: #94a3b8; }
.input-group .form-control { border-radius: 11px; }
.input-group > .form-control:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .btn { border-radius: 0 11px 11px 0; }

/* === Buttons === */
.btn { border-radius: 11px; font-weight: 600; padding: .6rem 1.15rem; transition: transform .12s ease, box-shadow .15s ease, filter .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: linear-gradient(135deg, var(--pay-primary) 0%, var(--pay-primary-600) 100%);
    border: none; box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .6);
}
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg, var(--pay-primary-600) 0%, var(--pay-primary-700) 100%); filter: brightness(1.02); }
.btn-success {
    background: linear-gradient(135deg, var(--pay-success) 0%, var(--pay-success-600) 100%);
    border: none; box-shadow: 0 6px 16px -6px rgba(22, 163, 74, .55);
}
.btn-success:hover, .btn-success:focus { filter: brightness(1.03); }
.btn-secondary { background: #fff; color: #475569; border: 1px solid var(--pay-line); box-shadow: var(--pay-shadow-sm); }
.btn-secondary:hover { background: #f1f5f9; color: var(--pay-ink); border-color: #cbd5e1; }
.btn-danger { box-shadow: 0 6px 16px -6px rgba(220, 38, 38, .5); }
.btn-sm { padding: .35rem .7rem; border-radius: 9px; }
#btn_checkout { font-weight: 700; letter-spacing: .02em; padding-left: 1.5rem; padding-right: 1.5rem; }

/* === Microform containers === */
#number-container, #securityCode-container {
    height: 46px; padding: 9px 14px;
    border: 1px solid var(--pay-line); border-radius: 11px; background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.flex-microform-focused { border-color: var(--pay-primary); outline: 0; box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .18); }
.flex-microform-valid { color: var(--pay-success); }
.flex-microform-invalid { color: #dc3545; }

/* === Alerts & badges === */
.alert { border-radius: 12px; border: 1px solid transparent; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* === Tables (admin + receipt) === */
.table { --bs-table-bg: transparent; color: var(--pay-ink); }
.table > thead th {
    border-bottom: 2px solid var(--pay-line); color: var(--pay-muted);
    font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
}
.table > tbody > tr { border-color: var(--pay-line); }
.table-bordered { border-radius: 12px; overflow: hidden; }
#pay_receipt th { background: #f8fafc; width: 40%; }

/* === Admin shell polish === */
.container > h2:first-of-type, .container > h1:first-of-type { margin-bottom: 1.25rem; }
.badge { font-weight: 600; border-radius: 8px; padding: .4em .65em; }

/* === 3DS overlays (unchanged behaviour) === */
#threeds-challenge-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, .65); z-index: 9999; display: none; }
#threeds-challenge-container iframe { background: #fff; margin: 5vh auto; display: block; border: 0; border-radius: 14px; max-width: 95vw; box-shadow: var(--pay-shadow); }
#ddc-container { display: none; }
.loading-overlay { display: none; position: fixed; inset: 0; background: rgba(248, 250, 252, .78); backdrop-filter: blur(2px); z-index: 9998; align-items: center; justify-content: center; color: var(--pay-primary); }
.loading-overlay.active { display: flex; }

/* === Mobile responsive === */
@media (max-width: 768px) {
    .card-body { padding: 1.15rem; }
    .step-wizard .step small { font-size: .68rem; }
    .step-wizard .step::before { top: 17px; }
    .circle { width: 36px; height: 36px; line-height: 36px; font-size: 14px; }
    .pay-logo { max-height: 62px; }
    h2 { font-size: 1.45rem; }
    h3 { font-size: 1.25rem; }
    .step-content h4 { font-size: 1.08rem; }
    #threeds-challenge-container iframe { width: 100% !important; height: 100% !important; margin: 0; border-radius: 0; }
}

@media (max-width: 480px) {
    body { font-size: 14.5px; }
    .container { padding-left: 14px; padding-right: 14px; }
    .card-body { padding: 1rem; }
    .step-wizard .step small { font-size: .6rem; }
    .circle { width: 32px; height: 32px; line-height: 32px; font-size: 12px; }
    .step-wizard .step::before { top: 15px; height: 2px; }
    .pay-logo { max-height: 52px; }
    .d-flex.justify-content-between { flex-direction: column-reverse; gap: .6rem; }
    .d-flex.justify-content-between .btn { width: 100%; }
    #btn_checkout, .text-end .btn { width: 100%; }
    .text-end { text-align: stretch !important; }
}

/* === Print === */
@media print {
    body { background: #fff; }
    .app-footer, .no-print, .step-wizard, #step1, #step2, #step3,
    .btn, #flex-error-badge, #recaptcha-widget { display: none !important; }
    #step4 { display: block !important; }
    .card { box-shadow: none; border: none; }
}
