/* =========================================================
   ۱. تعریف فونت‌ها
   ========================================================= */
@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: "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;
}

/* =========================================================
   ۲. متغیرها و ریست پایه (Base & Variables)
   ========================================================= */
:root {
    --primary: #1e3a8a;
    --primary-light: #2563eb;
    --primary-hover: #1d4ed8;
    --surface: #ffffff;
    --bg-page: #f1f5f9;
    --text-heading: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-full: 9999px;
    --shadow-soft: 0 4px 15px -2px rgba(15, 23, 42, 0.06);
    --shadow-float: 0 12px 25px -4px rgba(15, 23, 42, 0.12);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body.portal-body {
    font-family: "Vazirmatn", system-ui, -apple-system, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-body);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* =========================================================
   ۳. بخش هدر و معرفی (Hero - پیش‌فرض موبایل)
   ========================================================= */
.hero-section {
    position: relative;
    background: linear-gradient(165deg, #091e42 0%, #1e3a8a 65%, #2563eb 100%);
    color: #ffffff;
    padding: 36px 16px 48px;
    text-align: center;
}

.hero-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.35) 0%, transparent 70%);
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.hero-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    z-index: 2;
}

.org-brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 500;
    color: #f8fafc;
    margin-bottom: 18px;
    line-height: 1.4;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    background-color: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 8px #34d399;
    flex-shrink: 0;
}

.hero-main-title {
    font-family: "Lalezar", cursive, sans-serif;
    font-size: 1.75rem;
    line-height: 1.35;
    margin-bottom: 14px;
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.hero-lead-text {
    font-size: 0.88rem;
    color: #cbd5e1;
    margin-bottom: 24px;
    line-height: 1.65;
}

/* فرم پیگیری موبایل: المان‌ها تمام‌عرض و دکمه‌خور استاندارد */
.track-glass-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-lg);
    padding: 10px;
}

.track-inline-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-field-group {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 0 14px;
    height: 50px; /* حداقل ارتفاع ارگونومیک برای لمس در موبایل */
}

.field-icon {
    font-size: 1.1rem;
    margin-left: 8px;
    flex-shrink: 0;
}

.input-field-group input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-heading);
}

.btn-track-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    height: 50px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: background-color 0.2s, transform 0.1s;
}

.btn-track-submit:active {
    transform: scale(0.98);
}

/* =========================================================
   ۴. کانتینر اصلی و عنوان بخش‌ها (Content Flow)
   ========================================================= */
.portal-container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.section-heading {
    text-align: center;
    background: var(--surface);
    padding: 20px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
}

.section-title {
    font-family: "Lalezar", cursive, sans-serif;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 6px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* =========================================================
   ۵. شبکه کارت‌ها (Mobile 1-Column)
   ========================================================= */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr; /* در موبایل کارت‌ها تک‌ستونه و خوانا هستند */
    gap: 16px;
}

.service-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.service-icon-box {
    width: 48px;
    height: 48px;
    background: #eff6ff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card-inactive .service-icon-box {
    background: #f1f5f9;
}

.state-pill {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.state-pill.active {
    background: #ecfdf5;
    color: #059669;
}

.state-pill.coming-soon {
    background: #fef3c7;
    color: #d97706;
}

.card-inner-body {
    margin-bottom: 18px;
}

.card-dept-tag {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: 4px;
}

.card-item-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 6px;
}

.card-item-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.btn-primary-action,
.btn-disabled-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary-action {
    background: #eff6ff;
    color: var(--primary-light);
    border: 1px solid #bfdbfe;
}

.btn-primary-action:active {
    background: var(--primary-light);
    color: #ffffff;
}

.btn-disabled-action {
    background: #f8fafc;
    color: #94a3b8;
    border: 1px dashed #cbd5e1;
    cursor: pointer;
}

/* =========================================================
   ۶. پاپ‌آپ مدال مدرن (ریسپانسیو کامل)
   ========================================================= */
dialog.modern-dialog {
    border: none;
    border-radius: 20px;
    padding: 0;
    width: calc(100% - 32px);
    max-width: 420px;
    margin: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

dialog.modern-dialog::backdrop {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.dialog-content {
    padding: 24px 20px;
    text-align: center;
}

.dialog-icon-circle {
    font-size: 2.2rem;
    margin: 0 auto 12px;
    background: #fef3c7;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.dialog-content h3 {
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.dialog-content p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 20px;
}

.btn-dialog-dismiss {
    width: 100%;
    height: 48px;
    background: var(--primary-light);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.portal-footer {
    text-align: center;
    padding: 20px 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
}

/* =========================================================
   ۷. بهینه‌سازی برای تبلت و دسکتاپ (Responsive Scale-Up)
   ========================================================= */

/* تبلت (عرض بالای 640px) */
@media (min-width: 640px) {
    .hero-section {
        padding: 50px 24px 60px;
    }

    .hero-main-title {
        font-size: 2.2rem;
    }

    .track-inline-form {
        flex-direction: row;
    }

    .input-field-group {
        flex: 1;
    }

    .btn-track-submit {
        padding: 0 24px;
        width: auto;
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .section-title {
        font-size: 1.75rem;
    }
}

/* لپ‌تاپ و مانیتور (عرض بالای 1024px) */
@media (min-width: 1024px) {
    .hero-section {
        padding: 64px 30px 80px;
    }

    .hero-main-title {
        font-size: 2.7rem;
    }

    .hero-lead-text {
        font-size: 1.05rem;
    }

    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    .service-card {
        padding: 24px;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .service-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-float);
    }

    .btn-primary-action:hover {
        background: var(--primary-light);
        color: #ffffff;
    }
}