/* ==========================================================
   /payment — payment-form components only.
   Everything else (colours, fonts, header, footer, buttons, hero grid,
   light/dark theme) comes from the main site: /css/style.css
   ========================================================== */
:root { --ok: #22C55E; --err: #F87171; }
html.light { --ok: #16A34A; --err: #DC2626; }

/* ---------- page hero (site .hero look, payment layout) ---------- */
.pay-hero { padding: 64px 0 88px; min-height: calc(100vh - var(--header-h)); min-height: calc(100svh - var(--header-h)); }
/* full-width blueprint grid; the payment panel sits centred with equal space on both sides */
.pay-hero::before { inset: 0; opacity: .5; }
.pay-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 640px);
    justify-content: center;
}
.pay-panel { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }


/* ---------- card (same surface as the site's contact form) ---------- */
.pay-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px;
}
.pay-card .section-num { margin-bottom: 10px; }
.pay-card h2 { font-size: 24px; letter-spacing: -0.02em; margin-bottom: 6px; }
.pay-card h2 + .pay-chosen { margin-top: 18px; }
.pay-card .pay-sub { font-size: 15px; color: var(--text-3); margin-bottom: 24px; }
.pay-label { display: block; font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 8px; }
.pay-field { margin-bottom: 20px; border: 0; min-width: 0; }

/* product picker */
.pay-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 8px; margin-bottom: 22px; border: 0; min-width: 0; }
.pay-product { position: relative; }
.pay-product input { position: absolute; opacity: 0; pointer-events: none; }
.pay-product label {
    height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
    min-height: 86px; padding: 12px 8px; text-align: center; cursor: pointer;
    border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--bg);
    transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease);
}
.pay-product label:hover { border-color: var(--text-3); }
.pay-logo { width: 38px; height: 38px; border-radius: 8px; background: #fff; display: grid; place-items: center; flex-shrink: 0; }
.pay-logo img { width: 28px; height: 28px; object-fit: contain; }
.pay-product .pay-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.25; }
.pay-product input:checked + label { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px var(--blue-soft); }
.pay-product input:checked + label::after {
    content: '✓'; position: absolute; top: 6px; right: 6px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--blue); color: #fff; font-size: 9px; display: grid; place-items: center;
}
.pay-product input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 2px; }

/* chosen product (steps 2–3) */
.pay-chosen { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg); margin-bottom: 22px; }
.pay-chosen .pay-logo { width: 52px; height: 52px; border-radius: 12px; }
.pay-chosen .pay-logo img { width: 40px; height: 40px; }
.pay-chosen .pay-name { font-weight: 600; color: var(--text); }
.pay-chosen .pay-meta { font-size: 13px; color: var(--text-3); }
.pay-chosen > div { min-width: 0; }
.pay-chosen .pay-change { margin-left: auto; font-size: 14px; color: var(--blue); white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pay-chosen .pay-change i { font-size: 12px; }

/* inputs (same as the site's contact form) */
.pay-input, .pay-amount input {
    width: 100%; height: 48px; padding: 0 14px;
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    background: var(--bg); color: var(--text); font-size: 16px;
    transition: border-color .15s, box-shadow .15s;
}
.pay-input:focus, .pay-amount input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.pay-input::placeholder, .pay-amount input::placeholder { color: var(--text-3); }
.pay-amount { position: relative; }
.pay-amount input { height: 56px; padding-right: 64px; font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.pay-amount span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 14px; font-weight: 600; color: var(--text-3); }
.pay-hint { font-size: 13px; color: var(--text-3); margin-top: 6px; }
.pay-hint a { color: var(--blue); white-space: nowrap; }
.pay-hint a:hover { text-decoration: underline; }


.pay-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.pay-actions .btn-wide { width: 100%; }

/* summary / receipt */
.pay-summary { border-top: 1px solid var(--line); margin-bottom: 22px; }
.pay-summary div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.pay-summary dt { color: var(--text-3); }
.pay-summary dd { color: var(--text); font-weight: 500; text-align: right; word-break: break-word; }
.pay-summary .mono { font-size: 14px; }

/* alerts */
.pay-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; margin-bottom: 18px; border: 1px solid; color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); background: color-mix(in srgb, var(--err) 10%, transparent); }
.pay-alert i { margin-top: 3px; }

/* result */
.pay-result { text-align: center; padding: 4px 0 22px; }
.pay-result-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; }
.pay-result-icon.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.pay-result-icon.fail { background: color-mix(in srgb, var(--err) 15%, transparent); color: var(--err); }
.pay-result h2 { margin-bottom: 0; }
.pay-result .pay-big { font-family: var(--font-display); font-size: 36px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; margin-top: 6px; }
.pay-result .pay-sub { margin: 8px 0 0; }
.pay-secure { display: flex; align-items: flex-start; justify-content: center; gap: 8px; font-size: 13px; color: var(--text-3); margin-top: 18px; text-align: left; }
.pay-secure i { color: var(--teal); margin-top: 3px; }
.pay-cards { display: flex; justify-content: center; gap: 10px; margin-top: 10px; font-size: 26px; color: var(--text-3); }

/* submit in progress: block double payment, show it is working */
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading i { display: none; }
.btn.is-loading::before {
    content: ''; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent;
    animation: pay-spin .7s linear infinite;
}
@keyframes pay-spin { to { transform: rotate(360deg); } }

/* product not chosen yet: outline the tiles */
.pay-products.is-invalid .pay-product label { border-color: var(--err); }

/* ---------- responsive (same breakpoints as the site) ---------- */
@media (max-width: 640px) {
    .pay-hero { padding: 36px 0 56px; }
    .pay-card { padding: 22px 16px; }
    .pay-products { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .pay-actions { flex-direction: column-reverse; }
    .pay-actions .btn { width: 100%; height: 52px; }
}

/* small phones (≤ 400px) */
@media (max-width: 400px) {
    .pay-chosen { padding: 12px; gap: 12px; }
    .pay-chosen .pay-logo { width: 44px; height: 44px; }
    .pay-chosen .pay-logo img { width: 34px; height: 34px; }
    .pay-chosen .pay-change { width: 40px; justify-content: center; border: 1px solid var(--line-strong); border-radius: var(--radius); }
    .pay-chosen .pay-change span { display: none; }   /* pencil icon only */
    .pay-summary div { flex-direction: column; gap: 2px; }
    .pay-summary dd { text-align: left; }
    .pay-result .pay-big { font-size: 30px; }
    .pay-product label { min-height: 80px; padding: 10px 6px; }
    .pay-product .pay-name { font-size: 12px; }
}

/* very narrow phones: back to 2 per row so names fit */
@media (max-width: 340px) {
    .pay-products { grid-template-columns: repeat(2, 1fr); }
}

/* phones held sideways: little height — get to the form fast */
@media (max-height: 500px) and (orientation: landscape) {
    .pay-hero { padding: 24px 0 40px; }
}

/* ---------- print: receipt only ---------- */
@media print {
    .site-header, .mobile-nav, .site-footer, .pay-actions, .pay-secure, .pay-cards { display: none !important; }
    body { background: #fff; }
    .pay-hero::before { display: none; }
    .pay-inner { display: block; }
    .pay-card { border: 1px solid #ccc; background: #fff; }
    .pay-card * { color: #000 !important; }
}

/* header: show 'Ödəniş' as the current page */
.main-nav .nav-pay { color: var(--text); position: relative; }
.main-nav .nav-pay::after { content: ''; position: absolute; left: 0; right: 0; bottom: -23px; height: 2px; background: var(--blue); }

