/* KIIFF — Paper Modal v2 (light + tabbed) */
.kiff-paper-modal {
    position: fixed; inset: 0;
    background: rgba(4, 8, 14, .82);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    direction: rtl;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}
.kiff-paper-modal.active { display: flex; }

.kiff-pm-shell {
    width: 100%;
    max-width: 780px;
    margin: 20px auto;
    background: linear-gradient(180deg, #2d4156 0%, #1f2d3d 100%);
    border: 1px solid rgba(212, 175, 55, .55);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .6);
    overflow: hidden;
    animation: kiffPmIn .35s ease;
}
@keyframes kiffPmIn { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }

.kiff-pm-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 22px;
    background: linear-gradient(135deg, #D4AF37 0%, #C9A03D 100%);
    color: #0a121c;
}
.kiff-pm-title { font-weight: 900; font-size: 1.05rem; letter-spacing: .3px; }
.kiff-pm-close {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(0,0,0,.15); border: 0; color: #0a121c;
    font-size: 1.05rem; font-weight: 900; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: .2s;
}
.kiff-pm-close:hover { background: rgba(0,0,0,.3); transform: rotate(90deg); }

/* Tabs */
.kiff-pm-tabs {
    display: flex;
    background: #192230;
    border-bottom: 1px solid rgba(212, 175, 55, .25);
    padding: 6px 8px 0;
    gap: 4px;
    overflow-x: auto;
}
.kiff-pm-tab {
    flex: 1; min-width: 100px;
    padding: 12px 10px;
    background: transparent;
    border: 0; border-bottom: 3px solid transparent;
    color: #9AA5B1;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
    white-space: nowrap;
}
.kiff-pm-tab:hover { color: #E8EDF2; background: rgba(212,175,55,.05); }
.kiff-pm-tab.active {
    color: #D4AF37;
    border-bottom-color: #D4AF37;
    background: rgba(212,175,55,.08);
}

/* Body */
.kiff-pm-body {
    padding: 20px 22px 22px;
    background: #22314a;
    max-height: 62vh;
    overflow-y: auto;
}
.kiff-pm-body::-webkit-scrollbar { width: 6px; }
.kiff-pm-body::-webkit-scrollbar-thumb { background: #D4AF37; border-radius: 10px; }

.kiff-pm-pane { display: none; }
.kiff-pm-pane.active { display: block; animation: kiffPmFade .25s ease; }
@keyframes kiffPmFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Section */
.kiff-pm-section {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(212, 175, 55, .28);
    border-radius: 14px;
    padding: 16px 18px 18px;
    margin-bottom: 12px;
}
.kiff-pm-stitle {
    font-size: .95rem;
    font-weight: 800;
    color: #D4AF37;
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 1px dashed rgba(212, 175, 55, .35);
    display: flex; align-items: center; gap: 6px;
}

.kiff-pm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 640px) { .kiff-pm-grid { grid-template-columns: 1fr; } }
.kiff-pm-full { grid-column: 1 / -1; }

.kiff-pm-field { display: flex; flex-direction: column; gap: 5px; }
.kiff-pm-field label {
    font-size: .82rem;
    color: #E8EDF2;
    font-weight: 700;
}
.kiff-pm-field label .req { color: #ff8a8a; margin-right: 3px; }

.kiff-pm-input, .kiff-pm-select, .kiff-pm-textarea {
    width: 100%;
    background: rgba(255, 255, 255, .07);
    border: 1.5px solid rgba(212, 175, 55, .3);
    border-radius: 10px;
    padding: 11px 14px;
    color: #ffffff;
    font-family: inherit;
    font-size: .92rem;
    outline: none;
    transition: .2s;
}
.kiff-pm-input:focus, .kiff-pm-select:focus, .kiff-pm-textarea:focus {
    border-color: #D4AF37;
    background: rgba(255, 255, 255, .1);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, .18);
}
.kiff-pm-input::placeholder, .kiff-pm-textarea::placeholder {
    color: rgba(232, 237, 242, .35);
}
.kiff-pm-textarea { resize: vertical; min-height: 90px; line-height: 1.9; }
.kiff-pm-select { appearance: none; padding-left: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23D4AF37' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
}
.kiff-pm-select option { background: #1f2d3d; color: #fff; }

/* Subtabs (fa/en) */
.kiff-pm-subtabs {
    display: flex; gap: 6px; margin-bottom: 12px;
    background: rgba(0,0,0,.25); padding: 4px; border-radius: 10px;
    width: fit-content;
}
.kiff-pm-subtab {
    padding: 6px 14px;
    border: 0; border-radius: 8px;
    background: transparent; color: #9AA5B1;
    font-family: inherit; font-size: .82rem; font-weight: 700;
    cursor: pointer; transition: .2s;
}
.kiff-pm-subtab.active {
    background: linear-gradient(135deg, #D4AF37, #C9A03D);
    color: #0a121c;
}

/* File drop */
.kiff-pm-drop {
    display: block;
    border: 2px dashed rgba(212, 175, 55, .55);
    background: rgba(212, 175, 55, .06);
    border-radius: 14px;
    padding: 26px 20px;
    text-align: center;
    cursor: pointer;
    transition: .25s;
}
.kiff-pm-drop:hover, .kiff-pm-drop.drag-over {
    border-color: #D4AF37;
    background: rgba(212, 175, 55, .13);
    transform: translateY(-2px);
}
.kiff-pm-drop input[type=file] { display: none; }
.kiff-pm-drop-icon { font-size: 2.4rem; margin-bottom: 8px; }
.kiff-pm-drop-title { color: #E8EDF2; font-size: .95rem; font-weight: 700; margin-bottom: 4px; }
.kiff-pm-drop-hint { color: #9AA5B1; font-size: .78rem; }

.kiff-pm-fileinfo {
    display: none;
    margin-top: 12px;
    padding: 11px 14px;
    background: rgba(76, 175, 80, .12);
    border: 1px solid rgba(76, 175, 80, .45);
    border-radius: 10px;
    font-size: .85rem;
    color: #a8e6b8;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.kiff-pm-fileinfo.show { display: flex; }
.kiff-pm-fileinfo button {
    background: transparent; border: 0;
    color: #ff8a8a; font-size: 1.1rem; cursor: pointer;
    padding: 0 6px;
}

/* Payment box */
.kiff-pm-paybox {
    background: rgba(0,0,0,.15);
    border-radius: 10px;
    padding: 12px;
    color: #E8EDF2;
    font-size: .88rem;
    line-height: 1.9;
    text-align: center;
    min-height: 60px;
}

/* Actions */
.kiff-pm-actions {
    display: flex; gap: 10px; justify-content: flex-end;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(212, 175, 55, .25);
    flex-wrap: wrap;
}
.kiff-pm-btn {
    padding: 12px 26px;
    border-radius: 30px;
    font-family: inherit;
    font-size: .92rem;
    font-weight: 800;
    cursor: pointer;
    transition: .2s;
    border: 1.5px solid transparent;
}
.kiff-pm-btn.primary {
    background: linear-gradient(135deg, #D4AF37, #C9A03D);
    color: #0a121c;
    border-color: #D4AF37;
    box-shadow: 0 6px 16px rgba(212, 175, 55, .3);
}
.kiff-pm-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(212, 175, 55, .4); }
.kiff-pm-btn.primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.kiff-pm-btn.ghost {
    background: transparent;
    color: #E8EDF2;
    border-color: rgba(232, 237, 242, .3);
}
.kiff-pm-btn.ghost:hover { background: rgba(255,255,255,.06); border-color: #E8EDF2; }

.kiff-pm-help {
    text-align: center;
    font-size: .78rem;
    color: #9AA5B1;
    margin-top: 12px;
    line-height: 1.8;
}

/* Success */
.kiff-pm-success {
    display: none;
    text-align: center;
    padding: 30px 20px;
}
.kiff-pm-success.show { display: block; animation: kiffPmFade .4s ease; }
.kiff-pm-check {
    width: 76px; height: 76px;
    border-radius: 50%;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, #2b8a4a, #155c31);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.4rem; font-weight: 900;
    box-shadow: 0 10px 30px rgba(76, 175, 80, .35);
}
.kiff-pm-success h3 { color: #E8EDF2; font-size: 1.25rem; margin-bottom: 10px; }
.kiff-pm-success p { color: #9AA5B1; font-size: .9rem; line-height: 1.9; margin-bottom: 8px; }
.kiff-pm-track {
    display: inline-block;
    padding: 16px 30px;
    margin: 12px 0 16px;
    background: rgba(212, 175, 55, .13);
    border: 2px dashed #D4AF37;
    border-radius: 14px;
    font-family: monospace;
    font-size: 1.35rem;
    font-weight: 900;
    color: #D4AF37;
    letter-spacing: 3px;
    direction: ltr;
}
.kiff-pm-success-note { font-size: .82rem !important; color: #6f8fa8 !important; }
.kiff-pm-success-actions {
    display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px;
}