/**
 * نام فایل: forms/assets/complaint.css
 * نگارش: 2.6.0 (بازبینی و ادغام جامع)
 * تاریخ: 2026/10/07 ـ 1405/07/16
 *
 * ویژگی‌ها:
 * - رفع کامل تداخل‌ها، کدهای مرده و تکرار سلکتورها
 * - هماهنگی رنگ‌بندی سازمانی و تایپوگرافی وزیرمتن و لاله‌زار
 * - پشتیبانی از خروجی چاپی، رندر اسناد و پنجره‌های SweetAlert2
 */

/* =========================================================
   ۱. فونت‌های ثابت وزیرمتن
   ========================================================= */
@font-face {
    font-family: "Vazirmatn";
    src: url("./fonts/Vazirmatn-Regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("./fonts/Vazirmatn-Medium.woff2") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("./fonts/Vazirmatn-SemiBold.woff2") format("woff2");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("./fonts/Vazirmatn-Bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("./fonts/Vazirmatn-ExtraBold.woff2") format("woff2");
    font-style: normal;
    font-weight: 800;
    font-display: swap;
}

/* =========================================================
   ۲. فونت متغیر وزیرمتن
   ========================================================= */
@font-face {
    font-family: "Vazirmatn Variable";
    src: url("./fonts/Vazirmatn[wght].woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

/* =========================================================
   ۳. فونت نمایشی عنوان اصلی (لاله‌زار)
   ========================================================= */
@font-face {
    font-family: "Lalezar";
    src:
        url("./fonts/Lalezar-Regular.woff2") format("woff2"),
        url("./fonts/Lalezar-Regular.woff") format("woff");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

/* =========================================================
   ۴. متغیرهای طراحی
   ========================================================= */
:root {
    --primary: #0284c7;
    --primary-hover: #0369a1;

    --background: #f8fafc;
    --surface: #ffffff;
    --border: #d8e0e8;

    --text: #1e293b;
    --text-muted: #596779;

    --focus-ring: rgba(2, 132, 199, 0.20);

    --font-body: "Vazirmatn", Tahoma, Arial, sans-serif;
    --font-heading: "Lalezar", "Vazirmatn", Tahoma, sans-serif;
    --font-code: Consolas, "Liberation Mono", monospace;

    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-extrabold: 800;

    --radius-field: 10px;
    --radius-panel: 16px;

    --shadow-panel: 0 4px 18px rgba(37, 51, 70, 0.04);
}

@supports (font-variation-settings: normal) {
    :root {
        --font-body: "Vazirmatn Variable", "Vazirmatn", Tahoma, Arial, sans-serif;
    }
}

/* =========================================================
   ۵. قواعد عمومی و تایپوگرافی پایه
   ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    direction: rtl;
    background: var(--background);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: var(--weight-regular);
    line-height: 1.95;
}

.container {
    width: 100%;
    max-width: 960px;
    margin: 32px auto;
    padding: 0 18px 40px;
}

h1, h2, h3 {
    line-height: 1.6;
    overflow-wrap: break-word;
}

h1 {
    margin: 0 0 8px;
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: clamp(26px, 3.5vw, 34px);
    font-weight: 400;
}

h2 {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: var(--weight-extrabold);
}

h3 {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: var(--weight-bold);
}

p {
    margin: 0 0 14px;
}

strong, b {
    font-weight: var(--weight-bold);
}

.pre-wrap {
    white-space: pre-wrap;
    word-break: break-word;
}

.req {
    color: #dc2626;
    font-weight: bold;
}

/* =========================================================
   ۶. هدر سامانه و ناوبری بالا
   ========================================================= */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.header-main-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-icon {
    font-size: 2.2rem;
}

.app-header h1 {
    margin: 0;
    font-size: 1.4rem;
    color: #1e293b;
}

.app-header .subtitle {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-back-home:hover {
    background-color: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-back-home .back-arrow {
    font-size: 1.1rem;
    line-height: 1;
}

/* =========================================================
   ۷. فرم‌ها، کنترل‌های ورود و اعتبارسنجی
   ========================================================= */
fieldset {
    min-width: 0;
    margin: 24px 0;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-panel);
}

legend {
    max-width: 100%;
    padding: 0 10px;
    color: var(--primary);
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: var(--weight-extrabold);
    line-height: 1.8;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
}

.grid > * {
    min-width: 0;
}

.grid .wide {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: var(--weight-semibold);
    line-height: 1.8;
}

input,
select,
textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-top: 7px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-field);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: var(--weight-regular);
    line-height: 1.8;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

input, select {
    min-height: 48px;
}

textarea {
    min-height: 140px;
    line-height: 2;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 1px;
    border-color: var(--primary);
}

input:disabled,
select:disabled,
textarea:disabled {
    background: #edf1f5;
    color: #667587;
    cursor: not-allowed;
}

input[readonly],
textarea[readonly] {
    background: #f7f9fb;
}

input::placeholder,
textarea::placeholder {
    color: #687587;
    font-size: 14px;
    opacity: 1;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: #b33b3b;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 18px 0;
    font-size: 15px;
    font-weight: var(--weight-medium);
    cursor: pointer;
}

.checkbox input {
    width: 20px;
    min-height: 20px;
    height: 20px;
    margin: 4px 0 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.help {
    display: block;
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

#lookup-message {
    min-height: 28px;
    margin-top: 6px;
    color: #b91c1c;
    font-size: 14px;
    font-weight: var(--weight-semibold);
}

/* =========================================================
   ۸. پیام‌ها و اطلاعیه‌ها
   ========================================================= */
.notice {
    margin: 20px 0;
    padding: 18px 22px;
    border: 1px solid #c8deeb;
    border-radius: 12px;
    background: #edf7fc;
    font-size: 15px;
    line-height: 2;
}

.notice.error {
    border-color: #edb7b7;
    background: #fff0f0;
    color: #8b2525;
}

.notice.success {
    border-color: #b2dac3;
    background: #eefaf3;
    color: #205b3b;
}

.alert-warning {
    background-color: #fffbeb;
    border-right: 4px solid #f59e0b;
    color: #92400e;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 16px;
}

/* =========================================================
   ۹. دکمه‌ها و بخش عملیات فرم
   ========================================================= */
.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 26px;
}

button,
.button,
.btn-primary {
    display: inline-block;
    min-height: 48px;
    padding: 12px 26px;
    border: 0;
    border-radius: var(--radius-field);
    background: var(--primary);
    color: #fff;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: var(--weight-bold);
    line-height: 1.8;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

button:hover,
.button:hover,
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

button:focus-visible,
.button:focus-visible {
    outline: 3px solid #7dd3fc;
    outline-offset: 3px;
}

button:disabled {
    background: #94a3b8;
    color: #fff;
    box-shadow: none;
    cursor: not-allowed;
}

.preview-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.btn-confirm {
    background-color: #16a34a;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
}

.btn-confirm:hover {
    background-color: #15803d;
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 12px 20px;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

/* =========================================================
   ۱۰. بخش بازبینی داده‌ها (پیش‌نمایش)
   ========================================================= */
.review-panel {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-panel);
    padding: 24px;
    box-shadow: var(--shadow-panel);
}

.review-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.review-header h2 {
    margin: 0 0 6px;
    font-size: 1.3rem;
    color: #0f172a;
}

.review-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.review-section {
    margin-bottom: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
}

.review-section h3 {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: #334155;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 6px;
}

.kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px 20px;
}

.kv-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kv-item.full-width {
    grid-column: 1 / -1;
}

.kv-item .k {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: bold;
}

.kv-item .v {
    font-size: 0.98rem;
    color: #0f172a;
}

.kv-item .title-value {
    font-weight: 700;
    color: #0369a1;
}

.kv-item .text-block {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    border-radius: 8px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* =========================================================
   ۱۱. کارت رسمی رسید نهایی شکواییه
   ========================================================= */
.receipt-outer-container {
    max-width: 680px;
    margin: 1.5rem auto;
    direction: rtl;
}

.receipt-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-panel);
    padding: 2rem 1.8rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

#receipt-capture-area {
    background-color: #ffffff;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
}

.receipt-org-header {
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.gov-text {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e293b;
}

.gov-subtext {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.receipt-status-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.receipt-status-badge .icon {
    font-size: 1.4rem;
    font-weight: 900;
}

.receipt-status-badge h2 {
    font-size: 1.05rem;
    margin: 0;
    font-weight: 800;
}

.receipt-instruction {
    text-align: center;
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.tracking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.tracking-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.tracking-box.highlight {
    background: #f0fdf4;
    border-color: #86efac;
}

.tracking-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.tracking-value {
    display: block;
    font-family: var(--font-code);
    font-size: 1.25rem;
    color: #0f172a;
    font-weight: 800;
    user-select: all;
}

.ltr-text {
    direction: ltr;
    letter-spacing: 1px;
}

.receipt-date-stamp {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 8px;
}

/* =========================================================
   ۱۲. پنل مدرن دریافت فایل و ناوبری رسید (UI/UX)
   ========================================================= */
.receipt-actions {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.actions-group-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    margin: 0 0 0.85rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.actions-group-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background-color: var(--primary);
    border-radius: 2px;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.action-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    cursor: pointer;
    text-align: right;
    transition: all 0.22s ease-in-out;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.08);
}

.btn-card-image:hover {
    border-color: #0284c7;
    background-color: #f8fafc;
}

.btn-card-pdf:hover {
    border-color: #e11d48;
    background-color: #fff1f2;
}

.action-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-card-image .action-card-icon {
    background-color: #e0f2fe;
    color: #0284c7;
}

.btn-card-pdf .action-card-icon {
    background-color: #ffe4e6;
    color: #e11d48;
}

.action-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-grow: 1;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

.card-subtitle {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
}

.action-card-badge {
    position: absolute;
    top: 10px;
    left: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.next-step-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 1.1rem 1.35rem;
    border-radius: 14px;
}

.strip-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.strip-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
}

.strip-desc {
    font-size: 0.8rem;
    color: #64748b;
}

.strip-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-sub-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 1.15rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-print {
    background-color: #ffffff;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-print:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.btn-track-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-track-primary:hover {
    background-color: var(--primary-hover);
}

.receipt-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding-top: 0.5rem;
}

.nav-ghost-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-ghost-link:hover {
    color: var(--primary);
}

.link-divider {
    color: #cbd5e1;
    font-size: 0.8rem;
}

/* =========================================================
   ۱۳. هماهنگی SweetAlert2 با تایپوگرافی
   ========================================================= */
.swal2-popup {
    font-family: var(--font-body) !important;
    direction: rtl !important;
    text-align: right !important;
    border-radius: 16px !important;
}

.swal2-title {
    font-family: var(--font-body) !important;
    font-weight: 800 !important;
    font-size: 1.15rem !important;
}

.swal2-html-container {
    font-size: 0.92rem !important;
    line-height: 1.7 !important;
    color: #475569 !important;
}

.swal2-confirm {
    border-radius: 10px !important;
    font-weight: 700 !important;
    padding: 10px 24px !important;
}

/* =========================================================
   ۱۴. نمایش واکنش‌گرا (موبایل و تبلت)
   ========================================================= */
@media (max-width: 640px) {
    .container {
        margin-top: 20px;
        padding-right: 12px;
        padding-left: 12px;
        padding-bottom: 28px;
    }

    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-back-home {
        width: 100%;
        justify-content: center;
    }

    h1 {
        font-size: 26px;
    }

    fieldset {
        margin: 20px 0;
        padding: 20px 14px;
        border-radius: 12px;
    }

    .grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .grid .wide {
        grid-column: auto;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .actions button,
    .actions .button {
        width: 100%;
    }

    .tracking-grid {
        grid-template-columns: 1fr;
    }

    .next-step-strip {
        flex-direction: column;
        align-items: stretch;
    }

    .strip-buttons {
        flex-direction: column;
    }

    .btn-sub-action {
        width: 100%;
    }

    .receipt-footer-links {
        flex-direction: column;
        gap: 0.75rem;
    }

    .link-divider {
        display: none;
    }
}

/* =========================================================
   ۱۵. رعایت ترجیح کاربر برای کاهش حرکت (Reduced Motion)
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    input, select, textarea, button, .button, .action-card {
        transition: none !important;
    }
}

/* =========================================================
   ۱۶. چاپ تمیز و اختصاصی (Print CSS)
   ========================================================= */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt;
    }

    .container {
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .no-print,
    .app-header,
    .actions,
    .preview-actions,
    .receipt-actions {
        display: none !important;
    }

    .receipt-card {
        border: 1px solid #777 !important;
        box-shadow: none !important;
        padding: 15px !important;
        border-radius: 8px !important;
    }

    .tracking-box {
        border: 1.5px solid #000000 !important;
        background: #ffffff !important;
    }

    .tracking-value {
        color: #000000 !important;
    }
}