/* OcrFarsi.ir — RTL Persian UI. Self-contained: no external CDN, no build step. */

:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-soft: #eff6ff;
    --accent: #0ea5a4;
    --accent-soft: #ecfdf5;
    --ink: #0f172a;
    --ink-soft: #475569;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f7f9fc;
    --card: #ffffff;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --ok: #16a34a;
    --ok-soft: #f0fdf4;
    --warn: #b45309;
    --warn-soft: #fffbeb;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
    --shadow: 0 10px 25px -12px rgba(15, 23, 42, .18);
    --shadow-lg: 0 25px 50px -20px rgba(15, 23, 42, .28);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Vazirmatn, IRANSans, "IRANSansX", "Segoe UI", Tahoma, Arial, sans-serif;
    line-height: 1.85;
    font-size: 15px;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

h1, h2, h3, h4, h5 { margin: 0 0 .6rem; line-height: 1.5; font-weight: 800; }
p { margin: 0 0 .8rem; }
ul { margin: 0; padding-inline-start: 1.2rem; }

.container { width: min(1180px, 100% - 2rem); margin-inline: auto; }

/* ---------------------------------------------------------------- header -- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 68px;
}

.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
    display: grid;
    place-items: center;
    width: 42px; height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: #fff;
    font-weight: 800;
    font-size: .82rem;
    letter-spacing: .5px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-size: 1.02rem; }
.brand-text small { color: var(--muted); font-size: .74rem; direction: ltr; }

.main-nav { display: flex; gap: 1.1rem; margin-inline-start: auto; }
.main-nav a { color: var(--ink-soft); font-weight: 600; font-size: .93rem; }
.main-nav a:hover { color: var(--brand); }

.header-actions { display: flex; align-items: center; gap: .5rem; }
.inline-form { display: inline; }

.wallet {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--accent-soft);
    border: 1px solid #bbf7d0;
    color: #065f46;
    border-radius: 999px;
    padding: .25rem .75rem;
    font-size: .85rem;
}
.wallet-label { color: #047857; }

/* --------------------------------------------------------------- buttons -- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: .58rem 1.05rem;
    font: inherit;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    transition: .15s ease;
    white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #0d8f8e; color: #fff; }
.btn-outline { border-color: var(--line); background: #fff; color: var(--ink-soft); }
.btn-outline:hover { border-color: #cbd5e1; color: var(--ink); }
.btn-ghost { background: var(--brand-soft); color: var(--brand-dark); }
.btn-ghost:hover { background: #dbeafe; color: var(--brand-dark); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.btn-block { width: 100%; }
.btn-lg { padding: .8rem 1.6rem; font-size: 1rem; }

/* ------------------------------------------------------------------ hero -- */
.hero {
    position: relative;
    padding: 3.2rem 0 2.4rem;
    background:
        radial-gradient(900px 380px at 85% -10%, #dbeafe 0%, transparent 60%),
        radial-gradient(700px 320px at 10% 0%, #ccfbf1 0%, transparent 55%);
    overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; align-items: start; }
.hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin-bottom: .7rem; }
.hero .lead { font-size: 1.05rem; color: var(--ink-soft); max-width: 46ch; }
.hero .free-note {
    display: inline-flex; align-items: center; gap: .45rem;
    background: var(--warn-soft);
    border: 1px solid #fde68a;
    color: var(--warn);
    border-radius: 999px;
    padding: .3rem .85rem;
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.hero-points { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .45rem; }
.hero-points li { display: flex; gap: .55rem; align-items: flex-start; color: var(--ink-soft); }
.hero-points li::before { content: "✓"; color: var(--ok); font-weight: 800; }

/* ---------------------------------------------------------- upload panel -- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-pad { padding: 1.4rem; }
.card-head { padding: 1rem 1.4rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-head h3 { margin: 0; font-size: 1.02rem; }

.dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius);
    background: #fbfdff;
    padding: 1.8rem 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: .15s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .dz-icon { font-size: 2.2rem; }
.dropzone .dz-title { font-weight: 800; margin-top: .3rem; }
.dropzone .dz-hint { color: var(--muted); font-size: .85rem; }
.dz-file { display: none; margin-top: .7rem; font-size: .88rem; color: var(--brand-dark); font-weight: 700; word-break: break-all; }
.dz-file.show { display: block; }

.actions-row { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }

.progress { margin-top: 1rem; display: none; }
.progress.show { display: block; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress-bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .25s ease; }

.result { margin-top: 1rem; display: none; }
.result.show { display: block; }
.preview-box {
    max-height: 260px;
    overflow: auto;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .8rem;
    white-space: pre-wrap;
    font-size: .9rem;
    line-height: 1.9;
}

.alert { border-radius: var(--radius-sm); padding: .7rem .9rem; font-size: .9rem; margin-top: .8rem; display: none; }
.alert.show { display: block; }
.alert-error { background: var(--danger-soft); border: 1px solid #fecaca; color: #991b1b; }
.alert-ok { background: var(--ok-soft); border: 1px solid #bbf7d0; color: #166534; }
.alert-info { background: var(--brand-soft); border: 1px solid #bfdbfe; color: var(--brand-dark); }
.alert-static { display: block; }

/* -------------------------------------------------------------- sections -- */
.section { padding: 3rem 0; }
.section-title { text-align: center; margin-bottom: 2rem; }
.section-title h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); }
.section-title p { color: var(--muted); max-width: 60ch; margin-inline: auto; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-sm); }
.feature .icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: grid; place-items: center; font-size: 1.3rem;
    background: var(--brand-soft); margin-bottom: .7rem;
}
.feature h3 { font-size: 1rem; }
.feature p { color: var(--ink-soft); font-size: .9rem; margin: 0; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; counter-reset: step; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; position: relative; }
.step::before {
    counter-increment: step; content: counter(step);
    position: absolute; inset-inline-start: 1.2rem; top: -14px;
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--brand); color: #fff; font-weight: 800; font-size: .85rem;
}
.step h4 { margin-top: .9rem; font-size: .98rem; }
.step p { color: var(--ink-soft); font-size: .88rem; margin: 0; }

/* --------------------------------------------------------------- pricing -- */
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; text-align: center; box-shadow: var(--shadow-sm); }
.plan.featured { border-color: var(--brand); box-shadow: var(--shadow-lg); position: relative; }
.plan.featured::after {
    content: "پیشنهاد ویژه";
    position: absolute; top: -12px; inset-inline-start: 50%; transform: translateX(50%);
    background: var(--brand); color: #fff; border-radius: 999px; padding: .1rem .7rem; font-size: .75rem; font-weight: 700;
}
.plan .pages { font-size: 1.6rem; font-weight: 800; color: var(--brand-dark); }
.plan .price { font-size: 1.35rem; font-weight: 800; margin: .4rem 0; }
.plan .price small { font-size: .75rem; color: var(--muted); font-weight: 600; }
.plan ul { list-style: none; padding: 0; margin: .8rem 0 1.1rem; color: var(--ink-soft); font-size: .88rem; }
.plan ul li { padding: .2rem 0; }

/* ------------------------------------------------------------------- faq -- */
.faq { display: grid; gap: .6rem; max-width: 860px; margin-inline: auto; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .85rem 1rem; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details[open] summary { color: var(--brand-dark); margin-bottom: .5rem; }
.faq p { color: var(--ink-soft); font-size: .9rem; margin: 0; }

/* ----------------------------------------------------------------- forms -- */
.auth-wrap { display: grid; place-items: center; padding: 2.6rem 0 3.4rem; }
.auth-card { width: min(460px, 100%); }
.auth-card .card-pad { padding: 1.6rem; }
.auth-head { text-align: center; margin-bottom: 1.2rem; }
.auth-head h1 { font-size: 1.35rem; }
.auth-head p { color: var(--muted); font-size: .9rem; margin: 0; }

.field { margin-bottom: .9rem; }
.field label { display: block; font-weight: 700; font-size: .87rem; margin-bottom: .3rem; }
.field input, .field select, .field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .6rem .75rem;
    font: inherit;
    font-size: .92rem;
    background: #fff;
    color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.field .hint { color: var(--muted); font-size: .78rem; margin-top: .2rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }

.text-danger { color: var(--danger); }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }

/* ---------------------------------------------------------------- tables -- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .89rem; }
table.data th, table.data td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.data th { background: #f8fafc; font-weight: 700; color: var(--ink-soft); }
table.data tr:hover td { background: #fbfdff; }
table.data td.wrap { white-space: normal; min-width: 220px; }

.badge { display: inline-block; border-radius: 999px; padding: .1rem .6rem; font-size: .78rem; font-weight: 700; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-err { background: var(--danger-soft); color: var(--danger); }
.badge-run { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--brand-soft); color: var(--brand-dark); }

/* ------------------------------------------------------------ dashboard -- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.stat .label { color: var(--muted); font-size: .82rem; }
.stat .value { font-size: 1.6rem; font-weight: 800; color: var(--brand-dark); }
.stat .value.small { font-size: 1rem; word-break: break-all; }

.two-col { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1.2rem; align-items: start; }
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }

/* --------------------------------------------------------------- footer -- */
.site-footer { background: #0f172a; color: #cbd5e1; margin-top: 3rem; padding: 2.4rem 0 1rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1.5rem; }
.site-footer h4, .site-footer h5 { color: #fff; }
.site-footer p { color: #94a3b8; font-size: .88rem; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer a { color: #cbd5e1; font-size: .88rem; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1e293b; margin-top: 1.6rem; padding-top: .9rem; color: #94a3b8; font-size: .82rem; }

/* ----------------------------------------------------------- responsive -- */
@media (max-width: 980px) {
    .hero-grid, .two-col, .footer-grid { grid-template-columns: 1fr; }
    .main-nav { display: none; }
    .header-inner { flex-wrap: wrap; padding-block: .6rem; }
}
@media (max-width: 560px) {
    .field-row { grid-template-columns: 1fr; }
    .header-actions .btn { padding: .45rem .7rem; font-size: .82rem; }
    .wallet { display: none; }
}
