/* ═══════════════════════════════════════════════════════════
   Crypto Payment Form v8 — Full viewport, no scroll
   ═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Reset & base ── */
.cpf-page,.cpf-overlay{box-sizing:border-box;font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;-webkit-font-smoothing:antialiased;color:#111827}
.cpf-page *,.cpf-overlay *{box-sizing:border-box;font-family:inherit}

/* ── Full viewport page container ── */
.cpf-page{
    width:100%;max-width:480px;
    margin:0 auto;
    /* Fill exactly the visible area — no scrolling on any screen */
    height:100dvh;
    height:calc(var(--vh,1vh)*100);
    display:flex;flex-direction:column;
    overflow:hidden;
    background:#fff;
    position:relative;
}

/* Set --vh on load and resize via JS (added inline below) */

/* ══ SHARED ════════════════════════════════════════════════════════════ */
.cpf-btn-blue{display:block;width:100%;padding:14px;background:#4361EE;color:#fff;font-size:15px;font-weight:600;border-radius:10px;border:none;cursor:pointer;transition:background .15s}
.cpf-btn-blue:hover{background:#3451d1}
.cpf-btn-blue:disabled{opacity:.55;cursor:not-allowed}
.cpf-btn-outline{display:block;width:100%;padding:13px;background:transparent;color:#6b7280;font-size:14px;font-weight:500;border-radius:10px;border:1.5px solid #e5e7eb;cursor:pointer;transition:background .15s}
.cpf-btn-outline:hover{background:#f9fafb}
.cpf-err{background:#fef2f2;border:1px solid #fecaca;color:#dc2626;border-radius:8px;padding:9px 13px;font-size:13px;margin-bottom:12px}
.cpf-field{margin-bottom:16px}
.cpf-field label{display:block;font-size:12px;font-weight:600;color:#374151;margin-bottom:5px;text-transform:uppercase;letter-spacing:.04em}
.cpf-field input{display:block;width:100%;padding:11px 13px;border:1.5px solid #d1d5db;border-radius:9px;font-size:14px;color:#111827;background:#fff;outline:none;transition:border-color .15s,box-shadow .15s}
.cpf-field input:focus{border-color:#4361EE;box-shadow:0 0 0 3px rgba(67,97,238,.1)}
.cpf-field input::placeholder{color:#9ca3af}
.cpf-gate{padding:48px 24px;text-align:center;color:#6b7280;font-size:15px}
.cpf-gate a{color:#4361EE}

/* ══ TOPBAR ═══════════════════════════════════════════════════════════ */
.cpf-bar{
    display:flex;align-items:center;justify-content:space-between;
    padding:10px 16px;
    border-bottom:1px solid #f0f0f0;
    background:#fff;
    flex-shrink:0;
    min-height:48px;
}
.cpf-bar>span{font-size:15px;font-weight:600;color:#6b7280}
.cpf-bar-link{font-size:13px;font-weight:600;color:#4361EE;text-decoration:none}
.cpf-back{font-size:28px;line-height:1;color:#9ca3af;background:none;border:none;cursor:pointer;padding:0;transition:color .15s;display:flex;align-items:center}
.cpf-back:hover{color:#111827}
.cpf-logout-btn{background:none;border:none;cursor:pointer;color:#9ca3af;padding:4px;display:flex;align-items:center;transition:color .15s}
.cpf-logout-btn:hover{color:#dc2626}

/* ══ LOGIN PAGE ═══════════════════════════════════════════════════════ */
.cpf-login-page{
    justify-content:center;
    align-items:center;
    padding:24px 28px;
    overflow-y:auto;
    gap:0;
}
.cpf-login-logo{display:flex;flex-direction:column;align-items:center;margin-bottom:28px}
.cpf-logo-name{margin-top:10px;font-size:22px;font-weight:700;color:#111827;letter-spacing:-.3px}
.cpf-login-page form,.cpf-pin-panel{width:100%;max-width:360px}

/* PIN user selector */
.cpf-pin-prompt{font-size:14px;font-weight:600;color:#374151;text-align:center;margin-bottom:12px}
.cpf-pin-users{display:flex;flex-direction:column;gap:8px}
.cpf-user-btn{
    display:flex;align-items:center;gap:12px;
    padding:12px 16px;
    background:#f9fafb;border:1.5px solid #e5e7eb;
    border-radius:10px;cursor:pointer;
    font-size:14px;font-weight:500;color:#111827;
    transition:border-color .15s,background .15s;text-align:left;width:100%;
}
.cpf-user-btn:hover{border-color:#4361EE;background:#f0f4ff}
.cpf-user-avatar{
    width:38px;height:38px;border-radius:50%;
    background:#4361EE;color:#fff;
    display:flex;align-items:center;justify-content:center;
    font-weight:700;font-size:15px;flex-shrink:0;
}
/* PIN entry */
.cpf-pin-back-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.cpf-pin-back{background:none;border:none;color:#4361EE;font-size:14px;cursor:pointer;padding:0;display:flex;align-items:center;gap:4px}
.cpf-pin-who{font-size:14px;font-weight:600;color:#111827}
.cpf-pin-dots{display:flex;justify-content:center;gap:16px;margin-bottom:16px}
.cpf-dot{
    width:16px;height:16px;border-radius:50%;
    border:2px solid #d1d5db;background:#fff;
    transition:background .15s,border-color .15s;
}
.cpf-dot-filled{background:#4361EE;border-color:#4361EE}
/* Shake animation */
.cpf-shake{animation:cpf-shake .4s ease}
@keyframes cpf-shake{0%,100%{transform:translateX(0)}20%{transform:translateX(-6px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(4px)}}
/* PIN keypad */
.cpf-pin-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:12px}
.cpf-pin-key{
    height:60px;background:#f3f4f6;border:none;border-radius:10px;
    font-size:24px;font-weight:500;color:#111827;cursor:pointer;
    transition:background .1s;display:flex;align-items:center;justify-content:center;
}
.cpf-pin-key:hover{background:#e5e7eb}
.cpf-pin-key:active{background:#d1d5db}
.cpf-pin-key-empty{visibility:hidden}
.cpf-pin-key:disabled{visibility:hidden}
/* Switch login button */
.cpf-switch-login-btn{background:none;border:none;color:#4361EE;font-size:13px;cursor:pointer;padding:0;text-decoration:underline}
.cpf-login-foot{margin-top:20px;text-align:center;color:#6b7280;font-size:13px;width:100%}
.cpf-login-foot p{margin:5px 0}
.cpf-login-foot a{color:#4361EE;text-decoration:none}
.cpf-tg-row{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:4px}

/* ══ PAYMENT FORM SCREEN ════════════════════════════════════════════════ */
.cpf-screen{
    flex:1;display:flex;flex-direction:column;
    overflow:hidden;background:#fff;
}
.cpf-form-body{
    flex:1;padding:14px 16px 8px;
    overflow-y:auto;
    min-height:0;
}
/* Store dropdown */
.cpf-sel-wrap{position:relative}
.cpf-sel-wrap select{
    display:block;width:100%;padding:10px 36px 10px 12px;
    border:2px solid #4361EE;border-radius:9px;
    font-size:14px;font-weight:500;color:#111827;background:#fff;
    appearance:none;-webkit-appearance:none;outline:none;cursor:pointer;
}
.cpf-sel-arr{position:absolute;right:11px;top:50%;transform:translateY(-50%);color:#4361EE;pointer-events:none;font-size:11px}
.cpf-form-body .cpf-field{margin-bottom:10px}
.cpf-form-body .cpf-field label{font-size:11px;margin-bottom:4px}
.cpf-form-body input[type="text"]{
    display:block;width:100%;padding:9px 12px;
    border:1.5px solid #e5e7eb;border-radius:8px;
    font-size:14px;color:#111827;background:#f9fafb;outline:none;
    transition:border-color .15s;
}
.cpf-form-body input:focus{border-color:#4361EE;background:#fff}
/* Amount display — scales to fill available space */
.cpf-amount{
    font-size:clamp(36px,10vw,60px);
    font-weight:700;color:#111827;
    text-align:center;
    padding:10px 0 4px;
    letter-spacing:-1.5px;
    line-height:1;
}
.cpf-limit-hint{font-size:12px;color:#9ca3af;text-align:center;margin-bottom:4px}

/* ── Numpad — fixed at bottom, fills width ── */
.cpf-numpad{
    background:#4361EE;
    border-radius:18px 18px 0 0;
    padding:14px 14px 20px;
    flex-shrink:0;
}
.cpf-numgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin-bottom:10px}
.cpf-key{
    display:flex;align-items:center;justify-content:center;
    height:clamp(48px,8vh,64px);
    background:transparent;border:none;color:#fff;
    font-size:clamp(20px,4vw,26px);font-weight:400;
    border-radius:8px;cursor:pointer;
    transition:background .1s;user-select:none;-webkit-user-select:none;
}
.cpf-key:hover{background:rgba(255,255,255,.12)}
.cpf-key:active{background:rgba(255,255,255,.24)}
.cpf-pad-err{background:rgba(255,80,80,.22);color:#ffe0e0;border-radius:7px;padding:7px 12px;font-size:13px;margin-bottom:8px;text-align:center}
.cpf-btn-next{
    display:block;width:100%;padding:clamp(12px,2vh,16px);
    background:#fff;color:#111827;
    font-size:16px;font-weight:600;border-radius:10px;border:none;cursor:pointer;
    transition:background .15s;
}
.cpf-btn-next:hover{background:#f3f4f6}
.cpf-btn-next:disabled{opacity:.55;cursor:not-allowed}

/* ══ OVERLAY ════════════════════════════════════════════════════════════ */
.cpf-overlay{
    display:none;position:fixed;inset:0;z-index:999999;
    background:rgba(0,0,0,.44);
    align-items:flex-end;justify-content:center;
}
.cpf-overlay.open{display:flex;animation:cpf-bg .18s ease}
@keyframes cpf-bg{from{opacity:0}to{opacity:1}}

/* ── QR Popup ── */
.cpf-popup{
    background:#fff;border-radius:20px 20px 0 0;width:100%;max-width:480px;
    /* Fill most of screen — compact on Mac 13" */
    max-height:92dvh;max-height:calc(var(--vh,1vh)*92);
    overflow-y:auto;overscroll-behavior:contain;
    display:flex;flex-direction:column;
    animation:cpf-up .26s cubic-bezier(.32,1,.24,1);
}
@keyframes cpf-up{from{transform:translateY(70px);opacity:0}to{transform:translateY(0);opacity:1}}

/* Timer bar */
.cpf-timer-bar{
    height:4px;background:#f0f0f0;position:relative;flex-shrink:0;overflow:hidden;
}
.cpf-timer-fill{
    height:100%;background:#4361EE;
    transition:width .9s linear,background .5s;
    width:100%;
}
.cpf-timer-txt{
    position:absolute;right:10px;top:6px;
    font-size:11px;font-weight:600;color:#6b7280;
    line-height:1;
}

/* Popup rows */
.cpf-popup-rows{padding:10px 16px;border-bottom:1px solid #f0f0f0;flex-shrink:0}
.cpf-popup-row{display:flex;align-items:center;justify-content:space-between;min-height:42px}
.cpf-row-lbl{font-size:13px;font-weight:500;color:#111827}
.cpf-row-val{font-size:14px;font-weight:700;color:#111827;font-family:monospace}

/* Coin dropdown */
.cpf-dd{position:relative}
.cpf-dd-btn{display:flex;align-items:center;gap:8px;padding:7px 11px;border:2px solid #4361EE;border-radius:9px;background:#fff;cursor:pointer;font-size:13px;font-weight:500;color:#111827;min-width:150px;white-space:nowrap}
.cpf-dd-coin{width:24px;height:24px;border-radius:50%;object-fit:cover;flex-shrink:0}
#cpf-dd-caret{margin-left:auto;color:#4361EE;font-size:11px}
.cpf-dd-list{display:none;position:absolute;top:calc(100% + 4px);right:0;background:#fff;border:1px solid #e5e7eb;border-radius:11px;box-shadow:0 8px 24px rgba(0,0,0,.12);z-index:50;min-width:185px;max-height:220px;overflow-y:auto}
.cpf-dd-list.open{display:block}
.cpf-dd-item{display:flex;align-items:center;gap:10px;padding:8px 14px;cursor:pointer;font-size:13px;font-weight:500;color:#111827;transition:background .1s}
.cpf-dd-item:hover{background:#f3f4f6}
.cpf-dd-item.active{background:#eef1ff}
.cpf-dd-iico{width:28px;height:28px;border-radius:50%;object-fit:cover;flex-shrink:0}

/* QR area */
.cpf-qr-area{padding:12px 16px 6px;text-align:center;flex:1;display:flex;flex-direction:column;align-items:center}
.cpf-scan-lbl{font-size:15px;font-weight:700;color:#111827;margin-bottom:10px}
.cpf-qr-box{display:inline-flex;align-items:center;justify-content:center;padding:8px;border:3px solid #e5e7eb;border-radius:12px;background:#fff;margin-bottom:10px}
.cpf-qr-box img{display:block;width:clamp(150px,40vw,200px)!important;height:clamp(150px,40vw,200px)!important}
.cpf-addr-row{display:flex;align-items:center;gap:7px;background:#f3f4f6;border:1px solid #e5e7eb;border-radius:9px;padding:8px 10px;margin-bottom:8px;text-align:left;width:100%}
.cpf-addr-ic{color:#9ca3af;font-size:16px;flex-shrink:0}
#cpf-addr{flex:1;font-family:'Courier New',monospace;font-size:10.5px;color:#111827;word-break:break-all;background:none}
.cpf-copy-btn{background:#111827;color:#fff;border:none;border-radius:6px;padding:6px 11px;font-size:11px;font-weight:700;cursor:pointer;white-space:nowrap;flex-shrink:0;letter-spacing:.04em;transition:background .15s}
.cpf-copy-btn:hover{background:#374151}
.cpf-copy-btn.cpf-copied{background:#16a34a}

/* Expired state */
.cpf-expired-state{padding:16px;text-align:center;width:100%}
.cpf-expired-icon{font-size:36px;margin-bottom:8px}
.cpf-expired-txt{font-size:16px;font-weight:700;color:#111827;margin-bottom:4px}
.cpf-expired-sub{font-size:13px;color:#6b7280;margin-bottom:16px}

.cpf-btn-paid{display:block;width:calc(100% - 32px);margin:4px 16px 16px;padding:13px;background:#16a34a;color:#fff;font-size:14px;font-weight:600;border-radius:10px;border:none;cursor:pointer;transition:background .15s;flex-shrink:0}
.cpf-btn-paid:hover{background:#15803d}

/* ══ RECEIPT MODAL ═══════════════════════════════════════════════════════ */
.cpf-receipt-modal{
    background:#fff;border-radius:20px;width:calc(100% - 32px);max-width:420px;
    padding:28px 24px;position:relative;
    max-height:92dvh;overflow-y:auto;
    animation:cpf-up .26s cubic-bezier(.32,1,.24,1);
    text-align:center;
}
.cpf-receipt-close{
    position:absolute;top:14px;right:14px;
    background:#f3f4f6;border:none;border-radius:50%;
    width:32px;height:32px;font-size:14px;cursor:pointer;
    display:flex;align-items:center;justify-content:center;
    color:#6b7280;transition:background .15s;
}
.cpf-receipt-close:hover{background:#e5e7eb;color:#111827}
.cpf-receipt-check{
    width:64px;height:64px;border-radius:50%;
    display:flex;align-items:center;justify-content:center;
    font-size:26px;color:#fff;margin:0 auto 14px;
    background:linear-gradient(135deg,#22c55e,#15803d);
    box-shadow:0 6px 20px rgba(34,197,94,.28);
}
.cpf-receipt-title{font-size:20px;font-weight:700;margin:0 0 6px;color:#111827}
.cpf-receipt-sub{font-size:13px;color:#6b7280;margin:0 0 14px}
.cpf-receipt-amount{font-size:28px;font-weight:700;color:#111827;letter-spacing:-1px;margin-bottom:2px}
.cpf-receipt-crypto{font-size:13px;color:#4361EE;font-weight:600;font-family:monospace;margin-bottom:16px}
.cpf-receipt-table{text-align:left;width:100%;margin-bottom:4px}

/* ══ HISTORY ═════════════════════════════════════════════════════════════ */
.cpf-hist-list{flex:1;overflow-y:auto;padding:12px}
.cpf-hcard{padding:12px;border:1px solid #e5e7eb;border-radius:10px;margin-bottom:8px;background:#fff}
.cpf-hcard-main{width:100%}
.cpf-hcard-top{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:10px}
.cpf-hc-store{font-weight:600;font-size:13px;color:#111827;margin-bottom:2px}
.cpf-hc-note{font-size:12px;color:#6b7280;margin-bottom:2px}
.cpf-hc-date{font-size:11px;color:#9ca3af}
.cpf-hc-usd{font-weight:700;font-size:15px;color:#111827;margin-bottom:2px}
.cpf-hc-coin{font-size:12px;color:#6b7280}
.cpf-hc-st{display:inline-block;padding:2px 9px;border-radius:20px;font-size:11px;font-weight:600;margin-top:3px}
.cpf-st-processed{background:#fef9c3;color:#92400e}
.cpf-st-completed{background:#d1fae5;color:#065f46}
.cpf-empty{padding:40px;text-align:center;color:#9ca3af}

/* Transaction detail table */
.cpf-tx-details{border-top:1px solid #f0f0f0;padding-top:8px}
.cpf-tx-table{width:100%;border-collapse:collapse}
.cpf-tx-label{font-size:11px;color:#6b7280;padding:3px 0;width:40%;font-weight:500}
.cpf-tx-val{font-size:11px;color:#111827;padding:3px 0;font-family:monospace}
.cpf-tx-cur{color:#9ca3af;font-size:10px}
.cpf-tx-green{color:#16a34a;font-weight:600}
.cpf-tx-hash{font-size:10.5px}
.cpf-tx-link{color:#4361EE;text-decoration:none}
.cpf-tx-link:hover{text-decoration:underline}
.cpf-tx-conf{font-weight:600}
.cpf-conf-ok{color:#16a34a}
.cpf-conf-pending{color:#d97706}

/* ══ RESPONSIVE — Mac 13" and small screens ══════════════════════════════ */
@media (max-height:740px) {
    .cpf-login-logo{margin-bottom:16px}
    .cpf-login-logo svg{width:56px;height:56px}
    .cpf-logo-name{font-size:18px;margin-top:7px}
    .cpf-amount{font-size:40px;padding:6px 0 2px}
    .cpf-form-body{padding:10px 14px 4px}
    .cpf-key{height:44px;font-size:20px}
    .cpf-numpad{padding:10px 12px 16px}
    .cpf-btn-next{padding:12px}
    .cpf-pin-key{height:50px;font-size:20px}
    .cpf-qr-box img{width:160px!important;height:160px!important}
    .cpf-popup-rows{padding:8px 14px}
    .cpf-qr-area{padding:8px 14px 4px}
    .cpf-scan-lbl{margin-bottom:6px}
}
@media (max-height:620px) {
    .cpf-amount{font-size:32px}
    .cpf-key{height:38px;font-size:18px}
    .cpf-numpad{padding:8px 10px 12px;border-radius:14px 14px 0 0}
    .cpf-qr-box img{width:140px!important;height:140px!important}
}
@media (max-width:400px) {
    .cpf-key{font-size:18px}
    .cpf-amount{font-size:36px}
}

/* ── JS: set --vh on load ── */
/* (inline script added by PHP in enqueue) */
