/* WISE shared design system — used across every page for a cohesive look. */

:root {
    color-scheme: light;

    /* Palette — monochrome-first, logo-aligned */
    --wz-bg: #fafafa;
    --wz-bg-2: #f5f5f7;
    --wz-ink: #1d1d1f;
    --wz-ink-soft: #2d2d2f;
    --wz-muted: #6e6e73;
    --wz-faint: #86868b;
    --wz-surface: #ffffff;
    --wz-surface-2: #f5f5f7;
    --wz-glass: rgba(255, 255, 255, 0.82);
    --wz-border: rgba(0, 0, 0, 0.08);
    --wz-border-strong: rgba(0, 0, 0, 0.14);

    /* Brand — logo black */
    --wz-primary: #000000;
    --wz-primary-strong: #1d1d1f;
    --wz-primary-soft: rgba(0, 0, 0, 0.06);
    --wz-primary-ring: rgba(0, 0, 0, 0.12);
    --wz-accent: #6e6e73;
    --wz-accent-soft: rgba(110, 110, 115, 0.12);
    --wz-emerald: #0f9d77;
    --wz-emerald-soft: rgba(15, 157, 119, 0.12);
    --wz-danger: #dc2626;
    --wz-danger-soft: rgba(220, 38, 38, 0.10);

    /* Effects */
    --wz-radius-sm: 12px;
    --wz-radius: 18px;
    --wz-radius-lg: 26px;
    --wz-radius-xl: 34px;
    --wz-shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.06);
    --wz-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    --wz-shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.12);
    --wz-grad-brand: linear-gradient(135deg, #1d1d1f, #3a3a3c);
    --wz-grad-soft: linear-gradient(135deg, #f5f5f7, #fafafa);

    --wz-font: "Vazir", Tahoma, "Segoe UI", system-ui, sans-serif;
    --wz-font-en: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wz-scope * { box-sizing: border-box; }

/* ---------- Layout primitives ---------- */
.wz-shell {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    color: var(--wz-ink);
    font-family: var(--wz-font);
    font-size: 16px;
    line-height: 1.85;
    background: var(--wz-bg);
    -webkit-font-smoothing: antialiased;
}

.wz-container {
    width: min(1140px, calc(100% - 40px));
    margin-inline: auto;
}

.wz-section { padding: clamp(48px, 8vw, 96px) 0; }

.wz-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 6px 14px;
    border-radius: 999px;
    color: var(--wz-primary-strong);
    background: var(--wz-primary-soft);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.wz-eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--wz-primary);
    box-shadow: 0 0 0 5px var(--wz-primary-ring);
}

.wz-h1 {
    margin: 0;
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.wz-h2 {
    margin: 0;
    font-size: clamp(1.7rem, 4vw, 2.9rem);
    font-weight: 900;
    line-height: 1.18;
    letter-spacing: -0.02em;
}

.wz-lead {
    margin: 0;
    color: var(--wz-muted);
    font-size: clamp(1rem, 2vw, 1.18rem);
    line-height: 1.8;
}

.wz-fineprint {
    margin: 0;
    color: var(--wz-faint);
    font-size: 0.86rem;
    line-height: 1.7;
}

/* ---------- Topbar ---------- */
.wz-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px clamp(16px, 4vw, 30px);
    background: rgba(250, 250, 250, 0.85);
    border-bottom: 1px solid var(--wz-border);
    backdrop-filter: blur(18px);
}

.wz-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: 0.06em;
    color: var(--wz-ink);
}

.wz-brand img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: contain;
    background: #fff;
    padding: 3px;
    box-shadow: var(--wz-shadow-sm);
}

.wz-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.wz-navlink {
    padding: 9px 15px;
    border-radius: 999px;
    color: var(--wz-muted);
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    border: 1px solid transparent;
    transition: 160ms ease;
}

.wz-navlink:hover,
.wz-navlink:focus-visible {
    color: var(--wz-primary-strong);
    background: var(--wz-primary-soft);
    outline: none;
}

/* ---------- Buttons ---------- */
.wz-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 12px 22px;
    border: 1px solid transparent;
    border-radius: var(--wz-radius);
    color: var(--wz-ink);
    background: var(--wz-surface);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, opacity 150ms ease;
    white-space: nowrap;
}

.wz-btn:hover,
.wz-btn:focus-visible { transform: translateY(-1px); outline: none; }

.wz-btn-primary {
    color: #fff;
    background: var(--wz-primary);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.wz-btn-primary:hover {
    background: var(--wz-primary-strong);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.wz-btn-accent {
    color: #fff;
    background: var(--wz-ink-soft);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.wz-btn-ghost {
    border-color: var(--wz-border-strong);
    background: rgba(255, 255, 255, 0.6);
    color: var(--wz-ink-soft);
}

.wz-btn-ghost:hover { background: var(--wz-surface); }

.wz-btn:disabled,
.wz-btn.is-disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

.wz-btn-lg { min-height: 58px; padding: 15px 30px; font-size: 1.08rem; }
.wz-btn-block { width: 100%; }

/* ---------- Cards ---------- */
.wz-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--wz-border);
    border-radius: var(--wz-radius-xl);
    background: var(--wz-glass);
    box-shadow: var(--wz-shadow);
    backdrop-filter: blur(16px);
    padding: clamp(20px, 4vw, 34px);
}

.wz-card-flat {
    border: 1px solid var(--wz-border);
    border-radius: var(--wz-radius-lg);
    background: var(--wz-surface);
    box-shadow: var(--wz-shadow-sm);
    padding: clamp(16px, 3vw, 24px);
}

/* ---------- Forms ---------- */
.wz-field {
    display: grid;
    gap: 8px;
    color: var(--wz-ink-soft);
    font-size: 0.92rem;
    font-weight: 800;
}

.wz-input,
.wz-select {
    width: 100%;
    min-height: 52px;
    padding: 13px 16px;
    border: 1px solid var(--wz-border-strong);
    border-radius: var(--wz-radius);
    color: var(--wz-ink);
    background: var(--wz-surface);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.wz-input:focus,
.wz-select:focus {
    border-color: var(--wz-primary);
    box-shadow: 0 0 0 4px var(--wz-primary-ring);
}

.wz-input.is-ltr { direction: ltr; text-align: left; }

.wz-inline {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: end;
}

/* ---------- Notice / badges ---------- */
.wz-notice {
    display: none;
    margin-top: 12px;
    padding: 12px 16px;
    border: 1px solid var(--wz-border);
    border-radius: var(--wz-radius);
    color: var(--wz-ink-soft);
    background: var(--wz-primary-soft);
    font-size: 0.93rem;
}

.wz-notice.is-visible { display: block; }
.wz-notice.is-error {
    color: var(--wz-danger);
    border-color: rgba(220, 38, 38, 0.24);
    background: var(--wz-danger-soft);
}
.wz-notice.is-success {
    color: #0a7256;
    border-color: rgba(15, 157, 119, 0.26);
    background: var(--wz-emerald-soft);
}

.wz-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--wz-primary-strong);
    background: var(--wz-primary-soft);
}

.wz-badge.is-ok { color: #0a7256; background: var(--wz-emerald-soft); }
.wz-badge.is-warn { color: #92600a; background: var(--wz-accent-soft); }

/* ---------- Stepper ---------- */
.wz-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wz-step {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 15px;
    border: 1px solid var(--wz-border);
    border-radius: 999px;
    color: var(--wz-faint);
    background: var(--wz-surface);
    font-size: 0.86rem;
    font-weight: 800;
    transition: 180ms ease;
}

.wz-step .wz-step-num {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--wz-surface-2);
    color: var(--wz-faint);
    font-size: 0.82rem;
    font-weight: 900;
}

.wz-step.is-active {
    color: var(--wz-primary-strong);
    border-color: var(--wz-primary-ring);
    background: var(--wz-primary-soft);
}
.wz-step.is-active .wz-step-num { background: var(--wz-primary); color: #fff; }

.wz-step.is-done { color: #0a7256; border-color: rgba(15, 157, 119, 0.26); }
.wz-step.is-done .wz-step-num { background: var(--wz-emerald); color: #fff; }

/* ---------- Progress ---------- */
.wz-progress {
    height: 10px;
    width: 100%;
    border-radius: 999px;
    background: var(--wz-surface-2);
    overflow: hidden;
}

.wz-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: var(--wz-primary);
    transition: width 400ms ease;
}

/* ---------- Modal ---------- */
.wz-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
}

.wz-modal.is-open { display: grid; }

.wz-modal-card {
    width: min(440px, 100%);
    display: grid;
    gap: 14px;
    padding: clamp(22px, 4vw, 32px);
    border: 1px solid var(--wz-border);
    border-radius: var(--wz-radius-xl);
    background: var(--wz-surface);
    box-shadow: var(--wz-shadow-lg);
    animation: wzPop 220ms cubic-bezier(.2, .8, .2, 1) both;
}

.wz-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.wz-modal-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--wz-border);
    border-radius: 50%;
    background: var(--wz-surface-2);
    color: var(--wz-muted);
    font-size: 1.1rem;
    cursor: pointer;
}

@keyframes wzPop {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Chat ---------- */
.wz-chat {
    overflow: hidden;
    border: 1px solid var(--wz-border);
    border-radius: var(--wz-radius-lg);
    background: var(--wz-surface);
    box-shadow: var(--wz-shadow-sm);
}

.wz-chat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--wz-border);
    background: var(--wz-surface-2);
}

.wz-chat-head img {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    object-fit: cover;
    background: #fff;
}

.wz-messages {
    height: min(46vh, 420px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding: 16px;
}

.wz-msg {
    width: fit-content;
    max-width: min(86%, 40rem);
    padding: 11px 15px;
    border: 1px solid var(--wz-border);
    border-radius: 16px;
    background: var(--wz-surface-2);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.7;
}

.wz-msg.user {
    align-self: flex-start;
    color: #fff;
    background: var(--wz-primary);
    border-color: transparent;
}

.wz-msg.bot { align-self: flex-end; }
.wz-msg.error { color: var(--wz-danger); background: var(--wz-danger-soft); border-color: rgba(220,38,38,.2); }

.wz-typing { display: inline-flex; gap: 5px; direction: ltr; }
.wz-typing span {
    width: 7px; height: 7px; border-radius: 50%;
    background: rgba(15, 23, 42, 0.4);
    animation: wzTyping 1s ease-in-out infinite;
}
.wz-typing span:nth-child(2) { animation-delay: .16s; }
.wz-typing span:nth-child(3) { animation-delay: .32s; }

@keyframes wzTyping {
    0%, 80%, 100% { opacity: .3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

.wz-chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid var(--wz-border);
}

.wz-chat-form .wz-input { text-align: right; direction: auto; }

/* ---------- Pages list ---------- */
.wz-pages {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wz-page-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid var(--wz-border);
    border-radius: var(--wz-radius);
    background: var(--wz-surface);
}

.wz-page-item .wz-page-index {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 8px;
    background: var(--wz-primary-soft);
    color: var(--wz-primary-strong);
    font-size: 0.8rem;
    font-weight: 900;
}

.wz-page-item .wz-page-body { min-width: 0; }
.wz-page-item .wz-page-title {
    display: block;
    font-weight: 800;
    font-size: 0.94rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wz-page-item .wz-page-url {
    display: block;
    direction: ltr;
    text-align: left;
    color: var(--wz-faint);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Plan cards ---------- */
.wz-plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.wz-plan {
    position: relative;
    display: grid;
    gap: 14px;
    padding: 24px;
    border: 1.5px solid var(--wz-border);
    border-radius: var(--wz-radius-lg);
    background: var(--wz-surface);
    box-shadow: var(--wz-shadow-sm);
    text-align: start;
    cursor: pointer;
    transition: 180ms ease;
}

.wz-plan:hover { transform: translateY(-3px); box-shadow: var(--wz-shadow); }

.wz-plan.is-selected,
.wz-plan.is-featured {
    border-color: var(--wz-primary);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
}

.wz-plan-tag {
    position: absolute;
    inset-block-start: -12px;
    inset-inline-end: 18px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--wz-primary);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 800;
}

.wz-plan-name { font-size: 1.2rem; font-weight: 900; }
.wz-plan-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    font-family: var(--wz-font);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--wz-primary-strong);
    font-variant-numeric: tabular-nums;
}
.wz-price-amount {
    font-family: inherit;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.wz-price-unit {
    font-family: inherit;
    font-size: 0.68em;
    font-weight: 800;
    color: var(--wz-muted);
}
.wz-plan-meta { color: var(--wz-muted); font-size: 0.9rem; font-weight: 700; }

.wz-pricing-modal-card {
    width: min(360px, 100%);
    justify-items: center;
    text-align: center;
}
.wz-pricing-modal-msg {
    margin: 0;
    font-family: var(--wz-font);
    font-size: 1.12rem;
    font-weight: 900;
    color: var(--wz-ink);
}

/* ---------- Helpers ---------- */
.wz-hidden { display: none !important; }
.wz-grid-gap { display: grid; gap: 14px; }
.wz-row { display: flex; flex-wrap: wrap; gap: 10px; }
.wz-spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wz-mt { margin-top: 16px; }
.wz-mt-lg { margin-top: 28px; }

@media (max-width: 880px) {
    .wz-plans { grid-template-columns: 1fr; }
    .wz-inline { grid-template-columns: 1fr; }
    .wz-chat-form { grid-template-columns: 1fr; }
    .wz-chat-form .wz-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
        scroll-behavior: auto !important;
    }
}
