/* ============================================
   گارانتی تصفیه آب - استایل فرم عمومی
   ============================================ */

.gw-container {
    max-width: 780px;
    margin: 40px auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.04);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    direction: rtl;
    transition: all 0.3s ease;
}

/* ===== هدر ===== */
.gw-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f4f9;
}

.gw-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1a2b4a;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.gw-header h2::before {
    content: "🛡️ ";
    font-size: 32px;
}

.gw-header p {
    font-size: 16px;
    color: #6b7a93;
    margin: 0;
}

/* ===== مراحل ===== */
.gw-step {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.gw-step-header {
    margin-bottom: 28px;
}

.gw-step-header h3 {
    font-size: 22px;
    font-weight: 600;
    color: #1a2b4a;
    margin: 0 0 6px 0;
}

.gw-step-header p {
    font-size: 15px;
    color: #6b7a93;
    margin: 0;
}

/* ===== فرم گروه‌ها ===== */
.gw-form-group {
    margin-bottom: 22px;
}

.gw-form-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #2d3e5f;
    margin-bottom: 6px;
}

.gw-form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.gw-form-row .gw-form-group {
    flex: 1;
    min-width: 200px;
}

/* ===== ورودی‌های بزرگ ===== */
.gw-input-large {
    width: 100%;
    padding: 16px 18px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #1a2b4a;
    transition: all 0.25s ease;
    box-sizing: border-box;
    font-family: inherit;
    direction: rtl;
}

.gw-input-large:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.gw-input-large::placeholder {
    color: #a0b3c9;
}

.gw-input-large.error {
    border-color: #e74c3c;
    background: #fef2f2;
}

.gw-textarea-large {
    width: 100%;
    padding: 16px 18px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #1a2b4a;
    transition: all 0.25s ease;
    box-sizing: border-box;
    font-family: inherit;
    direction: rtl;
    resize: vertical;
    min-height: 100px;
}

.gw-textarea-large:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

select.gw-input-large {
    appearance: none;
    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='%236b7a93' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    padding-left: 40px;
    cursor: pointer;
}

select.gw-input-large:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== کپچا ===== */
.gw-captcha-wrapper {
    background: #f8fafc;
    padding: 16px 20px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.gw-captcha-wrapper label {
    margin-bottom: 8px;
}

.gw-captcha-box {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.gw-captcha-label {
    font-size: 22px;
    font-weight: 700;
    color: #1a2b4a;
    background: #ffffff;
    padding: 8px 18px;
    border-radius: 10px;
    border: 2px solid #dce3ed;
    min-width: 100px;
    text-align: center;
}

.gw-captcha-input {
    width: 80px;
    padding: 14px 16px;
    font-size: 20px;
    font-weight: 600;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #1a2b4a;
    text-align: center;
    transition: all 0.25s ease;
}

.gw-captcha-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.gw-captcha-input.error {
    border-color: #e74c3c;
    background: #fef2f2;
}

.gw-captcha-refresh {
    background: #e2e8f0;
    border: none;
    border-radius: 10px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4a5a7a;
    transition: all 0.25s ease;
}

.gw-captcha-refresh:hover {
    background: #cbd5e1;
    transform: rotate(60deg);
}

.gw-captcha-refresh svg {
    width: 22px;
    height: 22px;
}

.gw-captcha-error {
    font-size: 14px;
    color: #e74c3c;
    margin-top: 6px;
}

/* ===== دکمه‌ها ===== */
.gw-btn-primary,
.gw-btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 18px 28px;
    font-size: 18px;
    font-weight: 700;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    color: #ffffff;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.gw-btn-primary svg,
.gw-btn-success svg {
    flex-shrink: 0;
}

.gw-btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.30);
}

.gw-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.40);
}

.gw-btn-primary:active {
    transform: translateY(0);
}

.gw-btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.30);
}

.gw-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.40);
}

.gw-btn-success:active {
    transform: translateY(0);
}

.gw-btn-large {
    padding: 20px 32px;
    font-size: 20px;
}

/* ===== پیام‌ها ===== */
.gw-message {
    margin-top: 16px;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    display: none;
}

.gw-message.error {
    display: block;
    background: #fef2f2;
    color: #b91c1c;
    border: 2px solid #fecaca;
}

.gw-message.success {
    display: block;
    background: #ecfdf5;
    color: #065f46;
    border: 2px solid #a7f3d0;
}

.gw-message.loading {
    display: block;
    background: #f0f4f9;
    color: #2d3e5f;
    border: 2px solid #dce3ed;
}

/* ============================================
   کارت نهایی گارانتی
   ============================================ */

.gw-warranty-card-final {
    max-width: 480px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 32px;
    box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.08);
    padding: 24px 24px 28px;
    border: 1px solid #e9edf3;
    transition: transform 0.25s ease, border-color 0.2s ease;
}

.gw-warranty-card-final:hover {
    transform: translateY(-6px);
    border-color: #b1d4f0;
    box-shadow: 0 20px 40px -14px rgba(2, 132, 199, 0.12);
}

/* ===== شماره کارت گارانتی ===== */
.gw-warranty-code {
    text-align: center;
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
}

.gw-code-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    display: block;
    letter-spacing: 0.5px;
}

.gw-code-value {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    display: block;
    margin-top: 2px;
    font-family: monospace;
    letter-spacing: 1px;
}

/* ===== وضعیت گارانتی ===== */
.gw-warranty-status {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 30px;
    margin-bottom: 14px;
    display: inline-block;
    width: auto;
    margin-left: auto;
    margin-right: auto;
    display: table;
}

.gw-status-active {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.gw-status-expired {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* ===== SVG در بالا ===== */
.gw-card-svg-top {
    text-align: center;
    margin-bottom: 8px;
}

.gw-card-svg-top svg {
    width: 100px;
    height: 100px;
}

/* ===== تصویر محصول با وضعیت روی گوشه ===== */
.gw-card-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 16px;
}

.gw-card-image-final {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e6f0fa, #d3e4f5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gw-card-image-final img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gw-product-placeholder-final {
    font-size: 56px;
    color: #0369a1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== وضعیت روی گوشه تصویر (absolute) ===== */
.gw-status-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 30px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.gw-status-badge.gw-status-active {
    background: #10b981;
    color: #ffffff;
}

.gw-status-badge.gw-status-expired {
    background: #ef4444;
    color: #ffffff;
}

/* ===== اطلاعات محصول ===== */
.gw-card-product-info {
    text-align: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f0f4f9;
}

.gw-product-name-final {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.gw-product-duration {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* ===== اطلاعات مشتری ===== */
.gw-card-customer-final {
    margin-bottom: 16px;
}

.gw-section-title-final {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f4f9;
}

.gw-customer-grid-final {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px 16px;
}

.gw-customer-grid-final .gw-field-final {
    display: flex;
    flex-direction: column;
}

.gw-customer-grid-final .gw-field-final.gw-full-final {
    grid-column: 1 / -1;
}

.gw-customer-grid-final .gw-label-final {
    font-size: 10px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.gw-customer-grid-final .gw-value-final {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

/* ===== اطلاعات گارانتی (کامل - فقط در حالت جستجو) ===== */
.gw-card-warranty-final {
    margin-bottom: 16px;
}

.gw-warranty-grid-final {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.gw-warranty-cell {
    background: #f8fafc;
    border-radius: 14px;
    padding: 10px 12px;
    text-align: center;
}

.gw-warranty-cell .gw-label-final {
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.3px;
	display:block;
}

.gw-warranty-cell .gw-value-final {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin-top: 2px;
}

.gw-warranty-cell .gw-value-final.gw-remain-final {
    color: #0369a1;
}

/* ===== اطلاعات گارانتی ساده (فقط در حالت ثبت) ===== */
.gw-card-warranty-simple {
    margin-bottom: 16px;
}

.gw-warranty-simple-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.gw-warranty-simple-cell {
    background: #f8fafc;
    border-radius: 14px;
    padding: 10px 12px;
    text-align: center;
}

.gw-warranty-simple-cell .gw-label-final {
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.gw-warranty-simple-cell .gw-value-final {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin-top: 2px;
}

/* ===== نوار پیشرفت (فقط در حالت جستجو) ===== */
.gw-card-progress-final {
    margin-top: 4px;
}

.gw-progress-wrap-final {
    background: #f1f5f9;
    border-radius: 40px;
    padding: 8px 12px;
}

.gw-progress-bar-final {
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 40px;
    overflow: hidden;
}

.gw-progress-fill-final {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0ea5e9, #3b82f6);
    border-radius: 40px;
    transition: width 0.8s ease;
}

.gw-progress-info-final {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    margin-top: 6px;
}

.gw-progress-info-final .gw-percent-final {
    font-weight: 700;
    color: #0369a1;
}

/* ===== کلاس‌های اختصاصی برای تشخیص حالت ===== */
.gw-card-register .gw-field-final .gw-value-final {
    color: #0f172a;
}

.gw-card-search .gw-field-final .gw-value-final {
    color: #0f172a;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 768px) {
    .gw-container {
        padding: 24px 20px;
        margin: 20px 16px;
        border-radius: 16px;
    }
    
    .gw-header h2 {
        font-size: 26px;
    }
    
    .gw-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .gw-form-row .gw-form-group {
        min-width: unset;
    }
    
    .gw-btn-large {
        padding: 16px 20px;
        font-size: 17px;
    }
    
    .gw-captcha-box {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .gw-captcha-label {
        font-size: 18px;
        padding: 6px 14px;
        min-width: 80px;
    }
    
    .gw-captcha-input {
        width: 70px;
        padding: 12px 14px;
        font-size: 18px;
    }
    
    .gw-warranty-card-final {
        padding: 18px 16px 20px;
    }
    
    .gw-customer-grid-final {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .gw-customer-grid-final .gw-field-final.gw-full-final {
        grid-column: 1;
    }
    
    .gw-warranty-grid-final {
        grid-template-columns: 1fr 1fr;
    }
    
    .gw-warranty-simple-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .gw-card-svg-top svg {
        width: 80px;
        height: 80px;
    }
    
    .gw-product-name-final {
        font-size: 20px;
    }
    
    .gw-code-value {
        font-size: 16px;
    }
    
    .gw-status-badge {
        font-size: 11px;
        padding: 3px 10px;
        top: 8px;
        left: 8px;
    }
}

@media (max-width: 480px) {
    .gw-container {
        padding: 18px 14px;
        margin: 12px 8px;
    }
    
    .gw-header h2 {
        font-size: 22px;
    }
    
    .gw-input-large,
    .gw-textarea-large {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .gw-btn-large {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .gw-captcha-box {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .gw-warranty-grid-final {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .gw-warranty-simple-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .gw-warranty-cell .gw-value-final {
        font-size: 13px;
    }
    
    .gw-warranty-simple-cell .gw-value-final {
        font-size: 13px;
    }
    
    .gw-card-svg-top svg {
        width: 70px;
        height: 70px;
    }
    
    .gw-product-name-final {
        font-size: 18px;
    }
    
    .gw-code-value {
        font-size: 14px;
    }
    
    .gw-status-badge {
        font-size: 10px;
        padding: 2px 8px;
        top: 6px;
        left: 6px;
    }
}