/* --- بارگذاری فونت‌های مدرن --- */
@font-face {
    font-family: 'Baloo Bhaijaan 2';
    src: url('https://quamtex.ir/fonts/webfonts/baloo-bhaijaan-2-arabic-500-normal.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Baloo Bhaijaan 2';
    src: url('https://quamtex.ir/fonts/webfonts/baloo-bhaijaan-2-latin-500-normal.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* --- متغیرهای رنگی و تنظیمات پایه --- */
:root {
    --primary: #112548;
    --primary-hover: #1e3a6e;
    --bg-input: #f8fafc;
    --border-light: #e2e8f0;
    --text-main: #334155;
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #dae0e2;
    font-family: "Baloo Bhaijaan 2", sans-serif;
    line-height: 1.6;
    font-weight: 900;
}

/* --- کانتینر اصلی --- */
.main-container {
    display: flex;
    flex-direction: row;
}

.main-content {
    direction: rtl;
    flex: 1;
    padding: clamp(1rem, 2vw, 2rem);
    margin: clamp(0.5rem, 1.5vw, 1.5rem);
    background-color: #ffffff;
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: var(--primary);
    text-align: center;
    height: fit-content;
}

h2 {
    font-size: 2rem;
    margin-bottom: 25px;
    font-weight: 800;
}

/* --- ساختار گرید فرم (BMI بخش ارتباط) --- */
.bmi {
    display: grid;
    grid-template-columns: 1.5fr 1fr; /* دو ستون: یکی برای پیام، یکی برای فیلدها */
    gap: 20px;
    margin: 20px 0;
    border-radius: 24px;
    background: #ffffff;
    border: 2px solid var(--border-light);
    padding: clamp(1rem, 3vw, 2rem);
    width: 100%;
    direction: ltr;
}

/* بخش سمت راست (فیلدهای ورودی) */
.right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.right h3, .textarea h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--primary);
    font-weight: 600;
}

/* بخش سمت چپ (متن پیام) */
.textarea {
    grid-row: span 3;
    display: flex;
    flex-direction: column;
    direction: rtl;
}

/* --- استایل اینپوت‌ها، سلکت و تسکت‌اریا --- */
input, select, textarea {
    font-family: "Baloo Bhaijaan 2", sans-serif;
    border: 2px solid var(--border-light);
    background-color: var(--bg-input);
    color: var(--primary);
    outline: none;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    text-align: center;
}

input, select {
    height: 52px;
    margin-bottom: 15px;
    padding: 0 15px;
    font-size: 1rem;
}

textarea {
    height: 100%;
    min-height: 250px;
    padding: 15px;
    text-align: right;
    resize: none;
    font-size: 1.1rem;
    width: 100%;
    align-self: center;
}

/* فوکوس و هاور مدرن */
input:hover, select:hover, textarea:hover {
    border-color: #cbd5e1;
    background-color: #fff;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(17, 37, 72, 0.1);
    transform: translateY(-2px);
}

/* --- دکمه ارسال --- */
.pop {
    grid-column: span 2;
    justify-self: center;
    width: 250px;
    height: 55px;
    font-size: 1.3rem;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--primary) 0%, #2c4a85 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(17, 37, 72, 0.2);
    margin-top: 20px;
    font-family: "Baloo Bhaijaan 2", sans-serif;
}

.pop:hover {
    background: linear-gradient(135deg, #1e3a6e 0%, #3b5d9c 100%);
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.pop:active {
    transform: translateY(-1px);
}

.pop:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

/* --- نوتیفیکیشن و پیام وضعیت --- */
#status-message {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 600;
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); } 
    to { opacity: 1; transform: translateY(0); }
}

/* --- ریسپانسیو (موبایل) --- */
@media (max-width: 850px) {
    .bmi {
        grid-template-columns: 1fr;
    }
    
    .textarea {
        grid-row: auto;
        order: 2; /* متن پیام پایین‌تر برود */
    }
    
    .right {
        order: 1; /* فیلدها بالا باشند */
    }

    .pop {
        grid-column: 1;
        order: 3;
        width: 100%;
    }
}

@media (max-width: 675px) {
    .main-container {
        flex-direction: column;
    }
    
    .main-content {
        margin: 10px;
        padding: 15px;
    }

    input, select, textarea {
        max-width: 100%;
    }
}

/* استایل فیلد ایمیل اختیاری */
input[type="email"]::placeholder {
    font-size: 0.9rem;
    opacity: 0.7;
}

.rtl {
    direction: rtl;
}