/* ===================================================
   استایل فرم کمک مالی اطعام علوی
   =================================================== */

.ataam-alavi-wrapper {
    max-width: 520px;
    margin: 30px auto;
    font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', sans-serif;
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
}

.ataam-alavi-wrapper * {
    box-sizing: border-box;
}

/* --- کارت اصلی فرم --- */
.ataam-alavi-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #f0ebe3;
}

/* --- هدر فرم --- */
.ataam-alavi-header {
    background: linear-gradient(135deg, #1a6b3c 0%, #2d9250 50%, #1a6b3c 100%);
    padding: 30px 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ataam-alavi-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    animation: ataam-pulse 4s ease-in-out infinite;
}

@keyframes ataam-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.ataam-alavi-header-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    position: relative;
    z-index: 1;
}

.ataam-alavi-header h2 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    position: relative;
    z-index: 1;
}

.ataam-alavi-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    margin: 0;
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

/* --- بدنه فرم --- */
.ataam-alavi-body {
    padding: 30px 25px;
}

/* --- بخش انتخاب مبلغ --- */
.ataam-alavi-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ataam-alavi-section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: #2d9250;
    border-radius: 4px;
    display: inline-block;
}

/* --- دکمه‌های مبلغ پیش‌فرض --- */
.ataam-alavi-amount-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.ataam-alavi-amount-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 14px 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ataam-alavi-amount-btn:hover {
    border-color: #2d9250;
    background: #f0faf4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 146, 80, 0.15);
}

.ataam-alavi-amount-btn.active {
    border-color: #2d9250;
    background: linear-gradient(135deg, #f0faf4, #e8f5e9);
    box-shadow: 0 4px 12px rgba(45, 146, 80, 0.2);
}

.ataam-alavi-amount-btn.active::after {
    content: '\2713';
    position: absolute;
    top: 6px;
    left: 8px;
    width: 20px;
    height: 20px;
    background: #2d9250;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ataam-alavi-amount-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #1a6b3c;
    margin-bottom: 4px;
}

.ataam-alavi-amount-label {
    display: block;
    font-size: 11px;
    color: #888;
}

/* --- ورودی مبلغ دلخواه --- */
.ataam-alavi-custom-amount-wrapper {
    margin-bottom: 20px;
    position: relative;
}

.ataam-alavi-custom-amount-wrapper label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.ataam-alavi-custom-input-group {
    display: flex;
    align-items: center;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease;
    background: #f8f9fa;
}

.ataam-alavi-custom-input-group:focus-within {
    border-color: #2d9250;
    box-shadow: 0 0 0 3px rgba(45, 146, 80, 0.1);
}

.ataam-alavi-custom-input-group input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 15px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: center;
    outline: none;
    font-family: inherit;
    direction: ltr;
}

.ataam-alavi-custom-input-group input::placeholder {
    color: #bbb;
    font-weight: 400;
    font-size: 13px;
}

.ataam-alavi-custom-input-group .ataam-alavi-input-suffix {
    padding: 12px 15px;
    color: #888;
    font-size: 13px;
    background: #f1f3f5;
    white-space: nowrap;
}

/* --- فیلد شماره تماس --- */
.ataam-alavi-phone-wrapper {
    margin-bottom: 20px;
}

.ataam-alavi-phone-wrapper label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.ataam-alavi-phone-input-group {
    display: flex;
    align-items: center;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease;
    background: #f8f9fa;
}

.ataam-alavi-phone-input-group:focus-within {
    border-color: #2d9250;
    box-shadow: 0 0 0 3px rgba(45, 146, 80, 0.1);
}

.ataam-alavi-phone-input-group .ataam-alavi-phone-prefix {
    padding: 12px 12px;
    color: #555;
    font-size: 14px;
    background: #f1f3f5;
    white-space: nowrap;
    font-weight: 600;
    border-left: 1px solid #e9ecef;
}

.ataam-alavi-phone-input-group input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 15px;
    font-size: 16px;
    color: #333;
    outline: none;
    font-family: inherit;
    direction: ltr;
    text-align: right;
    letter-spacing: 2px;
}

.ataam-alavi-phone-input-group input::placeholder {
    color: #bbb;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0;
}

/* --- دکمه پرداخت --- */
.ataam-alavi-submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #1a6b3c 0%, #2d9250 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.ataam-alavi-submit-btn:hover {
    background: linear-gradient(135deg, #145a32 0%, #248443 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 146, 80, 0.35);
}

.ataam-alavi-submit-btn:active {
    transform: translateY(0);
}

.ataam-alavi-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ataam-alavi-submit-btn .ataam-alavi-spinner {
    display: none;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: ataam-spin 0.8s linear infinite;
}

.ataam-alavi-submit-btn.loading .ataam-alavi-spinner {
    display: inline-block;
}

.ataam-alavi-submit-btn.loading .ataam-alavi-btn-text {
    display: none;
}

.ataam-alavi-submit-btn.loading .ataam-alavi-btn-loading-text {
    display: inline;
}

.ataam-alavi-btn-loading-text {
    display: none;
}

@keyframes ataam-spin {
    to { transform: rotate(360deg); }
}

/* --- پیام خطا --- */
.ataam-alavi-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-top: 15px;
    display: none;
    align-items: center;
    gap: 8px;
}

.ataam-alavi-error.show {
    display: flex;
}

.ataam-alavi-error-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* --- رسید پرداخت --- */
.ataam-alavi-receipt {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #f0ebe3;
    max-width: 520px;
    margin: 30px auto;
    font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', sans-serif;
    direction: rtl;
    text-align: right;
}

.ataam-alavi-receipt-header {
    background: linear-gradient(135deg, #1a6b3c 0%, #2d9250 100%);
    padding: 25px;
    text-align: center;
}

.ataam-alavi-receipt-header .receipt-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.ataam-alavi-receipt-header h2 {
    color: #fff;
    font-size: 20px;
    margin: 0 0 5px;
}

.ataam-alavi-receipt-header p {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    margin: 0;
}

.ataam-alavi-receipt-body {
    padding: 25px;
}

.ataam-alavi-receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px dashed #e9ecef;
}

.ataam-alavi-receipt-row:last-child {
    border-bottom: none;
}

.ataam-alavi-receipt-label {
    font-size: 13px;
    color: #888;
}

.ataam-alavi-receipt-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.ataam-alavi-receipt-value.amount {
    color: #1a6b3c;
    font-size: 18px;
    font-weight: 700;
}

.ataam-alavi-receipt-value.ref-id {
    direction: ltr;
    text-align: left;
    font-family: 'Vazirmatn', monospace;
}

.ataam-alavi-receipt-footer {
    padding: 15px 25px 25px;
    text-align: center;
}

.ataam-alavi-receipt-print-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 10px 30px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.ataam-alavi-receipt-print-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

/* --- پیام لغو / خطا --- */
.ataam-alavi-status-message {
    max-width: 520px;
    margin: 30px auto;
    font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', sans-serif;
    direction: rtl;
    text-align: center;
    padding: 30px;
    border-radius: 20px;
}

.ataam-alavi-status-message.cancelled {
    background: #fff8e1;
    border: 1px solid #ffecb3;
}

.ataam-alavi-status-message.failed {
    background: #fff5f5;
    border: 1px solid #fed7d7;
}

.ataam-alavi-status-message.error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
}

.ataam-alavi-status-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.ataam-alavi-status-message h3 {
    font-size: 18px;
    margin: 0 0 10px;
}

.ataam-alavi-status-message p {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px;
    line-height: 1.8;
}

.ataam-alavi-retry-btn {
    background: linear-gradient(135deg, #1a6b3c 0%, #2d9250 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.ataam-alavi-retry-btn:hover {
    background: linear-gradient(135deg, #145a32 0%, #248443 100%);
}

/* --- واکنش‌گرا --- */
@media (max-width: 560px) {
    .ataam-alavi-wrapper,
    .ataam-alavi-receipt,
    .ataam-alavi-status-message {
        margin: 15px 10px;
    }

    .ataam-alavi-amount-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .ataam-alavi-amount-btn {
        padding: 10px 8px;
    }

    .ataam-alavi-amount-value {
        font-size: 14px;
    }

    .ataam-alavi-header h2 {
        font-size: 18px;
    }

    .ataam-alavi-submit-btn {
        font-size: 15px;
        padding: 14px;
    }
}

/* --- انیمیشن‌ها --- */
.ataam-alavi-card,
.ataam-alavi-receipt,
.ataam-alavi-status-message {
    animation: ataam-fadeIn 0.5s ease;
}

@keyframes ataam-fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- پرینت رسید --- */
@media print {
    .ataam-alavi-receipt-print-btn,
    .ataam-alavi-retry-btn {
        display: none !important;
    }

    .ataam-alavi-receipt {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
