/* ===================================
   Crebi Pay - Public Payment Form
   =================================== */
:root {
    --cp-primary: #6366f1;
    --cp-primary-dark: #4f46e5;
    --cp-success: #10b981;
    --cp-warning: #f59e0b;
    --cp-danger: #ef4444;
    --cp-bg: #f8fafc;
    --cp-card: #ffffff;
    --cp-border: #e2e8f0;
    --cp-text: #1e293b;
    --cp-muted: #64748b;
    --cp-radius: 16px;
    --cp-shadow: 0 4px 24px rgba(99,102,241,.12);
    --cp-bkash: #E2136E;
    --cp-nagad: #F05A28;
    --cp-rocket: #8C3494;
}

.crebi-pay-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 620px;
    margin: 0 auto;
    background: var(--cp-card);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow);
    overflow: hidden;
    border: 1px solid var(--cp-border);
}

/* ===== STEPS ===== */
.crebi-steps {
    display: flex;
    align-items: center;
    padding: 24px 32px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}
.crebi-step { display: flex; align-items: center; flex-direction: column; gap: 6px; flex-shrink: 0; }
.crebi-step-circle {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,.2); border: 2px solid rgba(255,255,255,.5);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.7); font-size: 15px; font-weight: 600;
    transition: all .3s;
}
.crebi-step.active .crebi-step-circle  { background: #fff; color: var(--cp-primary); border-color: #fff; }
.crebi-step.done .crebi-step-circle    { background: var(--cp-success); border-color: var(--cp-success); color: #fff; }
.crebi-step-label { font-size: 11px; color: rgba(255,255,255,.7); font-weight: 500; white-space: nowrap; }
.crebi-step.active .crebi-step-label  { color: #fff; font-weight: 600; }
.crebi-step-line { flex: 1; height: 2px; background: rgba(255,255,255,.2); margin: 0 10px; }

/* ===== SECTION ===== */
.crebi-section { padding: 28px 32px; }
.crebi-section-intro { color: var(--cp-muted); font-size: 14px; margin: 0 0 20px; }

/* ===== TITLE BAR ===== */
.crebi-pay-title-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; background: var(--cp-bg);
    border-radius: 10px; margin-bottom: 20px;
}
.crebi-pay-title-bar h3 { margin: 0; font-size: 16px; color: var(--cp-text); }
.crebi-amount-display { font-size: 22px; font-weight: 700; color: var(--cp-primary); }
.crebi-amount-display span { font-size: 14px; font-weight: 500; }

/* ===== METHODS GRID ===== */
.crebi-methods-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.crebi-method-card {
    border: 2px solid var(--cp-border); border-radius: 12px;
    cursor: pointer; overflow: hidden; transition: all .2s;
}
.crebi-method-card:hover { border-color: var(--cp-primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(99,102,241,.15); }
.crebi-method-inner { padding: 16px; }
.crebi-method-logo { width: 52px; height: 52px; object-fit: contain; border-radius: 10px; display: block; margin-bottom: 10px; }
.crebi-method-name { font-weight: 700; font-size: 15px; color: var(--cp-text); }
.crebi-method-type { font-size: 11px; color: var(--cp-muted); margin: 2px 0 8px; }
.crebi-method-number {
    font-family: 'Courier New', monospace; font-size: 14px;
    font-weight: 600; color: var(--cp-primary);
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.crebi-copy-btn {
    background: var(--cp-bg); border: 1px solid var(--cp-border); border-radius: 6px;
    padding: 3px 8px; font-size: 11px; cursor: pointer; color: var(--cp-muted);
    transition: all .2s;
}
.crebi-copy-btn:hover { background: var(--cp-primary); color: #fff; border-color: var(--cp-primary); }

/* ===== INFO BOX ===== */
.crebi-info-box {
    background: #f0f4ff; border-left: 4px solid var(--cp-primary);
    border-radius: 10px; padding: 16px 18px; margin-bottom: 24px;
}
.crebi-info-box-title { font-weight: 600; font-size: 14px; color: var(--cp-primary); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.crebi-info-box ul { margin: 0; padding-left: 18px; }
.crebi-info-box li { font-size: 13px; color: var(--cp-text); margin-bottom: 5px; }

/* ===== BUTTONS ===== */
.crebi-step-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.crebi-step-actions--between { justify-content: space-between; }
.crebi-btn-main {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 28px; background: linear-gradient(135deg, var(--cp-primary), #8b5cf6);
    color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all .2s; text-decoration: none;
}
.crebi-btn-main:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,.4); }
.crebi-btn-main:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.crebi-btn-back {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 20px; background: var(--cp-bg); color: var(--cp-muted);
    border: 1.5px solid var(--cp-border); border-radius: 10px; font-size: 14px; cursor: pointer;
    transition: all .2s;
}
.crebi-btn-back:hover { border-color: var(--cp-primary); color: var(--cp-primary); }

/* ===== FORM ===== */
.crebi-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.crebi-field { margin-bottom: 18px; }
.crebi-field label { display: block; font-size: 13px; font-weight: 600; color: var(--cp-text); margin-bottom: 7px; }
.crebi-field label span { color: var(--cp-danger); }
.crebi-field input, .crebi-field select {
    width: 100%; padding: 12px 14px; border: 2px solid var(--cp-border); border-radius: 10px;
    font-size: 14px; color: var(--cp-text); background: #fff; box-sizing: border-box;
    transition: border-color .2s;
}
.crebi-field input:focus, .crebi-field select:focus { outline: none; border-color: var(--cp-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.crebi-field-hint { font-size: 11px; color: var(--cp-muted); margin-top: 5px; }
.crebi-field-error { font-size: 12px; color: var(--cp-danger); margin-top: 5px; }

/* Amount Summary */
.crebi-amount-summary {
    background: #f0fdf4; border: 1.5px solid #bbf7d0; border-radius: 10px;
    padding: 12px 16px; margin-bottom: 20px; font-size: 14px; color: #166534;
    display: flex; align-items: center; gap: 8px;
}
.crebi-amount-summary strong { font-size: 16px; }

/* Method Selector (Step 2) */
.crebi-method-selector { display: flex; gap: 10px; flex-wrap: wrap; }
.crebi-method-opt {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; border: 2px solid var(--cp-border); border-radius: 10px;
    cursor: pointer; font-size: 13px; font-weight: 500; transition: all .2s;
}
.crebi-method-opt:hover, .crebi-method-opt.selected { border-color: var(--cp-primary); background: #f0f4ff; color: var(--cp-primary); }
.crebi-method-opt input[type="radio"] { display: none; }
.crebi-method-opt img { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; }

/* ===== SUCCESS ===== */
.crebi-success-wrap { text-align: center; padding: 20px 0 10px; }
.crebi-success-icon {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, var(--cp-success), #34d399);
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; color: #fff; margin: 0 auto 20px;
    animation: crebiPop .5s cubic-bezier(.175, .885, .32, 1.275);
}
@keyframes crebiPop {
    0%   { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.crebi-success-wrap h2 { color: var(--cp-text); font-size: 24px; margin: 0 0 12px; }
.crebi-success-wrap p { color: var(--cp-muted); font-size: 15px; max-width: 360px; margin: 0 auto 24px; line-height: 1.6; }

/* ===== COPY TOAST ===== */
.crebi-copy-toast {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: #1e293b; color: #fff; padding: 10px 20px; border-radius: 8px;
    font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none;
    transition: all .3s;
}
.crebi-copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* WooCommerce payment page notice */
.crebi-pay-notice { background: #fef3c7; border-left: 4px solid #f59e0b; padding: 14px 18px; border-radius: 8px; font-size: 14px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .crebi-section { padding: 20px 18px; }
    .crebi-steps { padding: 20px 18px; }
    .crebi-form-row { grid-template-columns: 1fr; }
    .crebi-methods-grid { grid-template-columns: 1fr; }
    .crebi-method-opt { flex: 1; justify-content: center; }
    .crebi-pay-title-bar { flex-direction: column; gap: 8px; text-align: center; }
}

/* Selected method card highlight */
.crebi-method-card--selected {
    border-color: var(--cp-primary) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
    background: #fafbff;
}

/* WooCommerce notice */
.crebi-pay-notice {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    color: #92400e;
}

/* Form error (injected by JS) */
#crebiFormError {
    animation: crebiShake .4s ease;
}
@keyframes crebiShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}
