/* ==========================================================================
   پلتفرم یکپارچه DPP — سیستم طراحی مشترک
   این فایل در همهٔ صفحات (index.php، terms.php، login.php، ...) لود می‌شود
   تا رنگ، فونت، هدر و فوتر در کل پلتفرم یکسان بماند.
   ========================================================================== */

/* ============ توکن‌های طراحی ============ */
:root {
    --lapis: #1B4B7A;
    --lapis-dark: #0E2C48;
    --lapis-light: #E8F0F7;
    --gold: #A97C1F;
    --gold-soft: #F4E9D3;
    --paper: #FBF8F3;
    --ink: #16233D;
    --ink-soft: #5B6B82;
    --line: #E5E0D3;
    --sage: #1F7A5C;
    --sage-soft: #E4F3EC;
    --radius-s: 10px;
    --radius-m: 16px;
    --radius-l: 24px;
    --shadow-card: 0 1px 2px rgba(22,35,61,0.04), 0 8px 24px rgba(22,35,61,0.06);
    --max-width: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { overflow-x: hidden; }

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background-color: var(--paper);
    color: var(--ink);
    margin: 0;
    direction: rtl;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }

.skip-link {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
    background: var(--lapis); color: white;
}
.skip-link:focus {
    width: auto; height: auto;
    margin: 0; overflow: visible; clip: auto;
    padding: 12px 20px;
    top: 0; right: 0;
    z-index: 1000;
    border-radius: 0 0 0 10px;
}

:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ============ هدر (مشترک در همهٔ صفحات) ============ */
header {
    background: rgba(251,248,243,0.92);
    backdrop-filter: saturate(180%) blur(10px);
    position: sticky; top: 0; z-index: 100;
    border-bottom: 1px solid var(--line);
}
.nav-container {
    max-width: var(--max-width); margin: 0 auto; padding: 14px 20px;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.logo {
    font-size: 18px; font-weight: 800; color: var(--lapis); text-decoration: none;
    display: flex; align-items: center; gap: 8px;
}
.btn-login-nav {
    background: var(--lapis); color: white; text-decoration: none;
    padding: 10px 22px; border-radius: 999px; font-weight: 700; font-size: 14px;
    white-space: nowrap;
}
.btn-login-nav:hover { background: var(--lapis-dark); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* منوی همبرگری موبایل */
.menu-toggle {
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
    width: 40px; height: 40px; background: transparent; border: 1.5px solid var(--line);
    border-radius: 10px; cursor: pointer; flex-shrink: 0;
}
.menu-toggle span { display: block; width: 18px; height: 2px; background: var(--lapis-dark); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-menu { max-height: 0; overflow: hidden; background: white; transition: max-height 0.3s ease; }
.mobile-menu.open { max-height: 800px; border-top: 1px solid var(--line); }
.mobile-menu-inner {
    padding: 24px 20px; max-width: var(--max-width); margin: 0 auto;
    display: grid; grid-template-columns: 1fr; gap: 26px; text-align: center;
}
.mobile-menu-col h4 { color: var(--lapis-dark); font-size: 14px; font-weight: 700; margin: 0 0 12px; }
.mobile-menu-col a { display: block; padding: 7px 0; color: var(--ink-soft); text-decoration: none; font-size: 14px; }
.mobile-menu-col a:hover { color: var(--lapis); }

@media (min-width: 900px) {
    .menu-toggle { display: none; }
    .mobile-menu { display: none; }
}
@media (max-width: 560px) {
    .nav-container { flex-direction: column; gap: 10px; }
    .nav-actions { width: 100%; }
    .btn-login-nav { flex: 1; text-align: center; }
}

/* ============ هیرو (صفحهٔ اصلی) ============ */
.hero-section {
    background: linear-gradient(180deg, var(--lapis-dark) 0%, var(--lapis) 100%);
    color: white;
    padding: 56px 0 64px;
    overflow: hidden;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
}
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
    padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
    margin-bottom: 18px;
}
.hero-copy { text-align: center; }
.hero-copy h1 {
    font-size: clamp(26px, 5vw, 40px);
    line-height: 1.35; font-weight: 800; margin: 0 0 18px;
}
.hero-copy p {
    font-size: clamp(15px, 2vw, 17px); opacity: 0.88; max-width: 52ch; margin: 0 auto 28px;
}
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.btn-main, .btn-secondary {
    text-decoration: none; padding: 14px 30px; border-radius: 999px;
    font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 8px;
}
.btn-main { background: var(--gold); color: var(--lapis-dark); }
.btn-main:hover { background: #C79A3E; }
.btn-secondary { background: transparent; color: white; border: 1.5px solid rgba(255,255,255,0.5); }
.btn-secondary:hover { background: rgba(255,255,255,0.08); }

/* موکاپ نسخهٔ دیجیتال — عنصر هیروی صفحهٔ اصلی */
.rx-mockup {
    background: white; border-radius: var(--radius-l);
    padding: 22px; color: var(--ink); box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    max-width: 380px; margin: 0 auto; width: 100%;
}
.rx-mockup-head {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px dashed var(--line); padding-bottom: 14px; margin-bottom: 14px;
}
.rx-mockup-head .rx-symbol { font-size: 22px; font-weight: 800; color: var(--lapis); }
.rx-status {
    background: var(--sage-soft); color: var(--sage); font-size: 12px; font-weight: 700;
    padding: 5px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px;
}
.rx-field { font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.rx-field strong { color: var(--ink); font-size: 14px; }
.rx-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #F1EEE6; }
.rx-row:last-of-type { border-bottom: none; }
.rx-pill-icon {
    width: 34px; height: 34px; border-radius: 10px; background: var(--lapis-light);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rx-med { font-size: 14px; font-weight: 700; }
.rx-dose { font-size: 12px; color: var(--ink-soft); }
.rx-sign {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line);
}
.rx-doctor { font-size: 12px; color: var(--ink-soft); }
.rx-seal {
    width: 40px; height: 40px; border-radius: 50%; background: var(--gold-soft);
    border: 1.5px solid var(--gold); display: flex; align-items: center; justify-content: center;
}
@media (prefers-reduced-motion: no-preference) {
    .rx-mockup { animation: rxIn 0.7s cubic-bezier(.2,.8,.2,1) both; }
}
@keyframes rxIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============ نوار اعتماد ============ */
.trust-strip { background: white; border-bottom: 1px solid var(--line); padding: 22px 0; }
.trust-grid { display: grid; grid-template-columns: 1fr; gap: 16px; text-align: center; }
.trust-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.trust-item svg { color: var(--lapis); }
.trust-item span { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
a.trust-item { text-decoration: none; border-radius: var(--radius-s); padding: 6px 10px; transition: background 0.15s; }
a.trust-item:hover { background: var(--lapis-light); }
a.trust-item span { color: var(--lapis-dark); }

/* ============ ویژگی‌ها ============ */
.features-section { padding: 64px 0; }
.section-title { color: var(--lapis-dark); font-size: clamp(20px, 3vw, 26px); font-weight: 800; margin: 0 0 8px; text-align: center; }
.section-subtitle { text-align: center; color: var(--ink-soft); font-size: 15px; max-width: 55ch; margin: 0 auto 40px; }
.features-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.feature-card {
    background: white; border: 1px solid var(--line); padding: 26px;
    border-radius: var(--radius-m); box-shadow: var(--shadow-card);
    text-decoration: none; color: inherit; display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover, .feature-card:focus-visible { transform: translateY(-6px); box-shadow: 0 20px 44px rgba(22,35,61,0.12); }
.feature-card.primary { background: var(--lapis); color: white; border: none; }
.feature-icon {
    width: 46px; height: 46px; border-radius: var(--radius-s);
    background: var(--lapis-light); display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px; color: var(--lapis);
}
.feature-card.primary .feature-icon { background: rgba(255,255,255,0.15); color: white; }
.feature-card h3 { font-size: 17px; margin: 0 0 10px; font-weight: 700; }
.feature-card p { font-size: 14px; color: var(--ink-soft); margin: 0; }
.feature-card.primary p { color: rgba(255,255,255,0.85); }
.feature-cta { display: inline-block; margin-top: 12px; font-size: 12.5px; font-weight: 700; color: var(--lapis); }
.feature-card.primary .feature-cta { color: var(--gold-soft); }

/* ============ قیمت‌گذاری ============ */
.pricing-section { padding: 64px 0 80px; background: white; border-top: 1px solid var(--line); }
.plans-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.plan-card {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m);
    padding: 28px 24px; position: relative;
    text-decoration: none; color: inherit; display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.plan-card:hover, .plan-card:focus-visible { transform: translateY(-6px); box-shadow: 0 20px 44px rgba(22,35,61,0.14); }
.plan-card.featured:hover { box-shadow: 0 24px 52px rgba(169,124,31,0.22); }
.plan-card.featured { border: 2px solid var(--gold); background: white; box-shadow: var(--shadow-card); }
.featured-badge {
    position: absolute; top: -13px; right: 24px;
    background: var(--gold); color: white; padding: 4px 14px; border-radius: 999px;
    font-size: 11px; font-weight: 800;
}
.plan-name { font-size: 16px; font-weight: 700; color: var(--lapis-dark); margin-bottom: 6px; }
.plan-period { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }
.plan-price { font-size: 30px; font-weight: 800; margin-bottom: 20px; }
.plan-price span { font-size: 14px; font-weight: 400; color: var(--ink-soft); }
.plan-features { list-style: none; padding: 0; margin: 0 0 26px; border-top: 1px solid var(--line); padding-top: 16px; }
.plan-features li { font-size: 13.5px; color: var(--ink); padding: 6px 0; display: flex; gap: 8px; align-items: flex-start; }
.plan-features li.disabled { color: #B8B2A3; }
.btn-plan {
    display: block; text-align: center; background: var(--lapis-light); color: var(--lapis);
    text-decoration: none; padding: 13px; border-radius: 999px; font-weight: 700; font-size: 14px;
}
.btn-plan:hover { background: #DAE7F2; }
.plan-card.featured .btn-plan { background: var(--gold); color: white; }
.plan-card.featured .btn-plan:hover { background: #C79A3E; }

/* ============ آمار زندهٔ واقعی ============ */
.live-stats { background: white; padding: 50px 20px 56px; text-align: center; border-top: 1px solid var(--line); }
.live-stats-grid { display: grid; grid-template-columns: 1fr; gap: 28px; max-width: 900px; margin: 0 auto; }
.live-stat-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 74px; min-height: 74px; padding: 0 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--lapis) 0%, var(--lapis-dark) 100%);
    margin: 0 auto 12px;
    box-shadow: 0 10px 26px rgba(27,75,122,0.28);
}
.live-stat-number { font-size: 26px; font-weight: 900; color: var(--gold); direction: ltr; white-space: nowrap; }
.live-stat-label { font-size: 14px; font-weight: 700; color: var(--ink-soft); }

/* ============ فرم‌های احراز هویت (ثبت‌نام/ورود) ============ */
.auth-section { padding: 48px 20px 72px; }
.auth-box { max-width: 460px; margin: 0 auto; background: white; border: 1px solid var(--line); border-radius: var(--radius-l); padding: 32px 26px; box-shadow: var(--shadow-card); }
.auth-box h1 { text-align: center; color: var(--lapis-dark); font-size: 21px; font-weight: 800; margin: 0 0 24px; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 13.5px; color: var(--ink); }
.auth-field .hint { font-weight: 400; color: var(--ink-soft); font-size: 12px; }
.auth-field input, .auth-field select {
    width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-s);
    font-family: 'Vazirmatn', Tahoma, sans-serif; font-size: 14px; background: var(--paper); color: var(--ink);
}
.auth-field input:focus, .auth-field select:focus { outline: none; border-color: var(--lapis); background: white; }
.auth-field small.field-error { display: block; color: #B3261E; font-size: 12px; margin-top: 4px; }
.auth-submit {
    width: 100%; padding: 13px; background: var(--gold); color: white; border: none;
    border-radius: 999px; font-weight: 800; font-size: 15px; cursor: pointer; font-family: inherit; margin-top: 8px;
}
.auth-submit:hover { background: #C79A3E; }
.auth-submit:disabled { background: #D9C79A; cursor: not-allowed; }
.auth-alert { padding: 12px 14px; border-radius: var(--radius-s); margin-bottom: 18px; font-size: 13.5px; text-align: center; }
.auth-alert.error { background: #FCE8E8; color: #B3261E; }
.auth-alert.success { background: var(--sage-soft); color: var(--sage); }
.auth-link { text-align: center; margin-top: 18px; font-size: 13.5px; }
.auth-link a { color: var(--lapis); font-weight: 700; text-decoration: none; }
.auth-link a:hover { text-decoration: underline; }

.auth-section-gradient {
    background: linear-gradient(180deg, var(--lapis-dark) 0%, var(--lapis) 100%);
    min-height: calc(100vh - 200px);
    display: flex; align-items: center;
}
.auth-section-gradient .auth-box { box-shadow: 0 24px 60px rgba(0,0,0,0.35); }

.auth-alert-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.auth-alert-actions a {
    flex: 1; min-width: 130px; text-align: center; padding: 10px; border-radius: 999px;
    font-size: 12.5px; font-weight: 700; text-decoration: none; color: white;
}
.auth-alert-actions .btn-whatsapp { background: #25D366; }
.auth-alert-actions .btn-renew { background: var(--gold); }
.auth-alert-actions a:hover { opacity: 0.9; }
.legal-content { max-width: 780px; margin: 0 auto; padding: 56px 20px 72px; }
.legal-content h1 { color: var(--lapis-dark); font-size: clamp(24px, 4vw, 32px); font-weight: 800; margin: 0 0 8px; }
.legal-content .legal-updated { color: var(--ink-soft); font-size: 13px; margin: 0 0 40px; }
.legal-content h2 { color: var(--lapis-dark); font-size: 19px; font-weight: 700; margin: 36px 0 12px; }
.legal-content p { margin: 0 0 14px; color: var(--ink); }
.legal-content ul, .legal-content ol { margin: 0 0 14px; padding-right: 22px; }
.legal-content li { margin-bottom: 8px; }

/* ============ فوتر (مشترک در همهٔ صفحات) ============ */
footer { background: var(--lapis-dark); color: rgba(255,255,255,0.65); padding: 46px 20px 24px; font-size: 13px; }
footer a { color: white; text-decoration: none; }
footer a:hover { text-decoration: underline; }
.footer-columns {
    max-width: var(--max-width); margin: 0 auto 30px;
    display: grid; grid-template-columns: 1fr; gap: 30px;
    text-align: center;
}
.footer-col h4 { color: white; font-size: 15px; font-weight: 700; margin: 0 0 14px; }
.footer-col p { margin: 0 0 10px; line-height: 1.8; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-divider { max-width: var(--max-width); margin: 0 auto; border: none; border-top: 1px solid rgba(255,255,255,0.12); margin-bottom: 20px; }
.footer-contact { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; font-size: 14px; }
.footer-contact a { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.footer-contact a:hover { text-decoration: underline; }
.footer-copyright { text-align: center; }
@media (min-width: 720px) {
    .footer-columns { grid-template-columns: repeat(3, 1fr); text-align: center; }
}

/* ============ دسکتاپ (min-width) ============ */
@media (min-width: 720px) {
    .trust-grid { grid-template-columns: repeat(3, 1fr); }
    .features-grid { grid-template-columns: 1.1fr 1fr; }
    .features-secondary { display: flex; flex-direction: column; gap: 18px; }
    .plans-grid { grid-template-columns: repeat(3, 1fr); }
    .live-stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
    .hero-grid { grid-template-columns: 1.1fr 0.9fr; text-align: right; }
    .hero-copy { text-align: right; }
    .hero-copy p { margin-left: 0; margin-right: 0; }
    .hero-buttons { justify-content: flex-start; }
}
