/*  assets/styles/form.css  */

@import url('global.css'); 

.form-container {
    width: 100%;
    max-width: 500px; 
    margin: 0 auto;
    padding: 15px 20px; 
    box-sizing: border-box;
}

/* کنترل کلی تراز کادر فرم‌ها */
.form-group {
    margin-bottom: 16px; 
    text-align: right;
}

.form-group label {
    display: block;
    color: var(--primary-color); 
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem; 
    font-family: 'Samim', sans-serif;
}

/* سلکت‌باکس مدرن و ظریف انتخاب آسیاب */
.form-group select {
    width: 100%;
    padding: 10px 14px 10px 36px; 
    border: 1.5px solid var(--border-light);
    border-radius: 8px; 
    background: var(--primary-color); 
    color: var(--text-dark); 
    font-size: 15px;
    font-weight: 500;
    font-family: 'Samim', sans-serif;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%237A4E2D'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 18px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group select:focus {
    border-color: var(--secondary-color); /* فوکوس طلایی */
    box-shadow: 0 0 0 3px rgba(200, 155, 60, 0.2);
}

/* فیلد عددی وزن قهوه */
.input-number {
    width: 100%;
    padding: 10px 14px; /* کاهش سایز پدینگ */
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    background: var(--primary-color);
    color: var(--text-dark);
    font-size: 15px;
    font-weight: 500;
    font-family: 'Samim', sans-serif;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}

.input-number:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(200, 155, 60, 0.2);
}

/* دکمه‌های رادیویی ترکیبی لوکس */
.radio-group {
    display: flex;
    gap: 10px; 
}

.radio-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    padding: 10px 8px; 
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
    background: var(--primary-color);
    color: var(--text-dark);
    font-family: 'Samim', sans-serif;
    direction: ltr;
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
}

/* استایل حالت انتخاب شده رادیوباکس‌ها */
.radio-label:has(input:checked) {
    border-color: var(--secondary-color);
    background: #FFF9EE; 
    color: var(--accent-color);
    transform: translateY(-1px); 
}

/* ----------------- سیستم چک‌باکس سفارشی ----------------- */
.checkbox-group {
    display: flex !important;
    align-items: center !important;
    margin: 14px 0 !important;
    padding-right: 2px;
}

.checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer;
    user-select: none;
    font-size: 13px; 
    color: var(--primary-color);
    font-weight: bold;
    font-family: 'Samim', sans-serif;
}

.checkbox-label input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none;
}

.custom-checkbox {
    display: inline-block !important;
    width: 18px !important; 
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    background-color: var(--primary-color) !important;
    border: 1.5px solid var(--text-muted) !important;
    border-radius: 4px !important;
    transition: all 0.2s ease-in-out;
    position: relative !important;
    flex-shrink: 0 !important;
}

.checkbox-label:hover input ~ .custom-checkbox {
    border-color: var(--secondary-color) !important;
}

.checkbox-label input:checked ~ .custom-checkbox {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
}

.custom-checkbox::after {
    content: "" !important;
    position: absolute !important;
    display: none !important;
    left: 5px !important;
    top: 1.5px !important;
    width: 5px !important;
    height: 9px !important;
    border: solid var(--text-dark) !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
}

.checkbox-label input:checked ~ .custom-checkbox::after {
    display: block !important;
}

/* ----------------- فیلد نمایش لایو قیمت در انتهای فرم ----------------- */
.price-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(245, 241, 234, 0.05);
    border: 1px dashed var(--secondary-color);
    border-radius: 8px;
    padding: 12px 16px; 
    margin: 20px 0 12px 0;
}

.price-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-value {
    font-size: 1.15rem; 
    font-weight: 800;
    color: var(--secondary-color);
}

/* دکمه ارسال/ثبت سفارش فرم  */
.btn-submit {
    width: 100%; 
    max-width: 280px; 
    display: block;
    margin: 15px auto 0 auto; 
    background: var(--secondary-color);
    color: var(--text-dark);
    border-radius: 25px; 
    padding: 10px 20px;
    font-size: 15px; 
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: 'Samim', sans-serif;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(200, 155, 60, 0.2);
    text-align: center;
}

.btn-submit:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 15px rgba(200, 155, 60, 0.3);
}

.btn-submit:active {
    background: var(--accent-color);
    color: var(--primary-color);
    transform: translateY(0);
}

/* ----------------- پیام‌های سیستم (Toast) ----------------- */
.toast {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: var(--text-dark);
    padding: 12px 20px; /* ابعاد ظریف‌تر */
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Samim', sans-serif;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    border: 1px solid var(--secondary-color);
}

.toast.show {
    bottom: 24px;
}

/* ----------------- بخش دکمه‌های انتهای فرم ----------------- */
.form-actions {
    display: flex !important;
    gap: 10px !important; 
    margin-top: 18px !important;
    width: 100% !important;
    align-items: center !important; 
}


.form-actions .btn-submit,
.form-actions .btn-cancel {
    height: 38px !important; 
    margin: 0 !important; 
    padding: 0 16px !important; 
    box-sizing: border-box !important; 
    display: inline-flex !important;
    align-items: center !important; 
    justify-content: center !important; 
    font-family: 'Samim', sans-serif !important;
    border-radius: 8px !important; 
    text-decoration: none !important;
    vertical-align: middle !important;
}

/* استایل اختصاصی دکمه ثبت سفارش */
.form-actions .btn-submit {
    flex: 2 !important; 
    background: var(--secondary-color) !important;
    color: var(--text-dark) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border: 1px solid transparent !important; 
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 10px rgba(200, 155, 60, 0.15) !important;
}

.form-actions .btn-submit:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 12px rgba(200, 155, 60, 0.25) !important;
}

.form-actions .btn-submit:active {
    background: var(--accent-color) !important;
    color: var(--primary-color) !important;
    transform: translateY(0) !important;
}

.form-actions .btn-cancel {
    flex: 1 !important; 
    background: rgba(245, 241, 234, 0.04) !important;
    color: #e5c1a7 !important;
    border: 1px solid var(--border-light) !important; 
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.form-actions .btn-cancel:hover {
    background: rgba(245, 241, 234, 0.08) !important;
    color: #ff5252 !important; 
    border-color: rgba(255, 82, 82, 0.3) !important;
}

.form-actions .btn-cancel:active {
    transform: translateY(0) !important;
}
