@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

/* ===== BASE ===== */
.zibal-form-wrap {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    background: transparent;
}
.zibal-form-wrap * {
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
}

/* ===== BG HEARTS - hidden by default ===== */
.zibal-bg-pattern { display: none; }

/* ===== CARD ===== */
.zibal-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(192,57,43,0.10), 0 1px 6px rgba(0,0,0,0.06);
    border: 1.5px solid #e8c0b8;
    position: relative;
    z-index: 1;
}

/* ===== HEADER ===== */
.zibal-header {
    background: linear-gradient(135deg, #c0392b 0%, #96281b 50%, #1a3a8f 100%);
    padding: 1.5rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}
.zibal-header::before {
    content: '';
    position: absolute; top: -40px; left: -40px;
    width: 160px; height: 160px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
}
.zibal-header::after {
    content: '';
    position: absolute; bottom: -50px; right: -30px;
    width: 130px; height: 130px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}
.zibal-header-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    background: rgba(255,255,255,0.18);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(255,255,255,0.25);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}
.zibal-header-icon svg {
    width: 26px !important;
    height: 26px !important;
    display: block;
    flex-shrink: 0;
}
.zibal-header-text {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}
.zibal-header-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}
.zibal-header-sub {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.72);
    margin-top: 3px;
    line-height: 1.4;
}

/* ===== BODY PADDING ===== */
.zibal-body {
    padding: 1.5rem 1.75rem;
}

/* ===== AMOUNT BOX ===== */
.zibal-amount-box {
    background: linear-gradient(135deg, #1a3a8f 0%, #0f2461 100%);
    border-radius: 16px;
    padding: 1.25rem 1.4rem;
    margin-bottom: 0.4rem;
    position: relative;
    overflow: hidden;
}
.zibal-amount-box::before {
    content: '';
    position: absolute; top: -20px; right: -20px;
    width: 90px; height: 90px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}
.zibal-amount-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.55);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}
.zibal-amount-row {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}
.zibal-amount-inp {
    font-family: 'Vazirmatn', sans-serif !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    width: 100% !important;
    direction: ltr !important;
    text-align: right !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    line-height: 1.2 !important;
}
.zibal-amount-inp::placeholder {
    color: rgba(255,255,255,0.22) !important;
}
.zibal-amount-cur {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    padding: 4px 10px;
    border: 0.5px solid rgba(255,255,255,0.18);
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.zibal-amount-words {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    margin-top: 0.5rem;
    min-height: 1.2rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* ===== ERR MSG ===== */
.zibal-err {
    font-size: 0.72rem;
    color: #c0392b;
    margin-top: 0.3rem;
    margin-bottom: 0.4rem;
    display: none;
    font-weight: 500;
}

/* ===== PRESET BUTTONS ===== */
.zibal-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.zibal-preset {
    font-family: 'Vazirmatn', sans-serif !important;
    font-size: 0.72rem;
    font-weight: 600;
    background: #fff5f5;
    color: #c0392b;
    border: 1.5px solid #f0c0b8;
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.zibal-preset:hover,
.zibal-preset.active {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(192,57,43,0.3);
}

/* ===== DIVIDER ===== */
.zibal-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.1rem;
    color: #ccc;
    font-size: 0.75rem;
}
.zibal-divider::before,
.zibal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #f0ede6;
}

/* ===== FORM ROW ===== */
.zibal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ===== FIELD ===== */
.zibal-field {
    margin-bottom: 1rem;
}
.zibal-field label {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #444 !important;
    margin-bottom: 0.45rem !important;
    display: block !important;
    line-height: 1.3 !important;
}
.zibal-optional {
    color: #bbb;
    font-weight: 300;
    font-size: 0.72rem;
}

/* ===== INPUT WRAP ===== */
.zibal-input-wrap {
    position: relative;
}
.zibal-input-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    width: 15px;
    height: 15px;
    pointer-events: none;
    display: flex;
    align-items: center;
}
.zibal-field input,
.zibal-field textarea {
    font-family: 'Vazirmatn', sans-serif !important;
    width: 100% !important;
    background: #fafaf8 !important;
    border: 1.5px solid #e8e4dc !important;
    border-radius: 10px !important;
    padding: 0.7rem 2.2rem 0.7rem 0.9rem !important;
    font-size: 0.84rem !important;
    color: #1a1a2e !important;
    outline: none !important;
    box-shadow: none !important;
    height: auto !important;
    direction: rtl !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
    line-height: 1.5 !important;
    display: block !important;
    -webkit-appearance: none !important;
}
.zibal-field input:focus,
.zibal-field textarea:focus {
    border-color: #c0392b !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(192,57,43,0.08) !important;
}
.zibal-field input::placeholder,
.zibal-field textarea::placeholder {
    color: #ccc !important;
    font-family: 'Vazirmatn', sans-serif !important;
}
.zibal-field textarea {
    resize: none !important;
    height: 80px !important;
    padding-top: 0.7rem !important;
}

/* ===== SECURE NOTE ===== */
.zibal-secure {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f4ff;
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    margin-bottom: 1rem;
    font-size: 0.73rem;
    color: #1a3a8f;
    line-height: 1.5;
    border: 1px solid #d0d8f0;
}
.zibal-secure svg {
    flex-shrink: 0;
    color: #1a3a8f;
}

/* ===== PAY BUTTON ===== */
.zibal-pay-btn {
    font-family: 'Vazirmatn', sans-serif !important;
    width: 100% !important;
    background: linear-gradient(135deg, #c0392b 0%, #96281b 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    transition: transform 0.15s, box-shadow 0.15s !important;
    box-shadow: 0 5px 20px rgba(192,57,43,0.4) !important;
    letter-spacing: 0.02em !important;
    -webkit-appearance: none !important;
}
.zibal-pay-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 28px rgba(192,57,43,0.5) !important;
}
.zibal-pay-btn:active {
    transform: translateY(0) !important;
}
.zibal-pay-btn.loading {
    opacity: 0.65 !important;
    cursor: default !important;
    pointer-events: none !important;
}

/* ===== SPINNER ===== */
.zibal-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: zibalSpin 0.7s linear infinite;
    display: none;
    flex-shrink: 0;
}
@keyframes zibalSpin { to { transform: rotate(360deg); } }

/* ===== FOOTER BADGES ===== */
.zibal-footer-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 1rem;
    font-size: 0.72rem;
    color: #bbb;
}

/* ===== ADMIN PREVIEW FIX ===== */
.wrap .zibal-form-wrap,
.zibal-wrap .zibal-form-wrap {
    max-width: 100% !important;
    margin: 0 !important;
}
.wrap .zibal-bg-pattern,
.zibal-wrap .zibal-bg-pattern {
    display: none !important;
}

/* ===== PROJECT FIELD ===== */
.zibal-project-wrap {
    display: flex;
    align-items: center;
}
.zibal-project-wrap input {
    flex: 1;
}
.zibal-project-link {
    flex-shrink: 0;
    margin-right: 8px;
    color: #c0392b;
    opacity: 0.6;
    display: flex;
    align-items: center;
    transition: opacity 0.15s;
}
.zibal-project-link:hover {
    opacity: 1;
}
