@font-face {
    font-family:"Yekan Bakh";
    src:url("fonts/YekanBakh-Regular.woff2") format("woff2");
    font-style:normal;
    font-weight:400;
    font-display:swap;
}
@font-face {
    font-family:"Yekan Bakh";
    src:url("fonts/YekanBakh-SemiBold.woff2") format("woff2");
    font-style:normal;
    font-weight:600;
    font-display:swap;
}
@font-face {
    font-family:"Yekan Bakh";
    src:url("fonts/YekanBakh-Bold.woff2") format("woff2");
    font-style:normal;
    font-weight:700;
    font-display:swap;
}

/*
 * TebTok design tokens — single source of truth for the whole product.
 * Every portal (patient, doctor, operations, system, support, landing, admin,
 * intake and the official report) derives its colors from these variables so
 * the brandbook stays visually consistent everywhere. Values follow the
 * official TebTok brand book.
 */
:root {
    /* Brand palette */
    --tebtok-blue:#1f67ed;          /* Primary Blue */
    --tebtok-blue-dark:#123e7c;     /* Deep Blue */
    --tebtok-blue-hover:#1a58cf;    /* Primary Blue, pressed/hover */
    --tebtok-aqua:#1dd0bd;          /* Primary Teal */
    --tebtok-soft-teal:#72dfd5;     /* Soft Teal */

    /* Brand aliases kept for backward compatibility */
    --tebtok-teal:#1dd0bd;
    --tebtok-navy:#123e7c;

    /* Neutrals */
    --tebtok-ink:#2f3a45;           /* Text Gray */
    --tebtok-muted:#6b7785;         /* Secondary Text */
    --tebtok-line:#dde8f3;          /* Border */
    --tebtok-bg:#f4f7fa;            /* Light Gray */
    --tebtok-surface:#ffffff;       /* Medical White */

    /* Soft brand tints (surfaces, selected/active states) */
    --tebtok-blue-soft:#eaf1ff;
    --tebtok-aqua-soft:#e5faf7;

    /* Semantic */
    --tebtok-alert:#e5484d;         /* Alert Red */
    --tebtok-warning:#f59e0b;       /* Warning */
    --tebtok-success:#22c55e;       /* Success */
    --tebtok-alert-soft:#fff0ee;
    --tebtok-warning-soft:#fff8e8;
    --tebtok-success-soft:#e6f7ee;

    /* Shared shape & elevation */
    --tebtok-radius:16px;
    --tebtok-radius-sm:10px;
    --tebtok-shadow:0 8px 26px rgba(18,62,124,.05);
    --tebtok-shadow-strong:0 16px 42px rgba(18,62,124,.09);

    /* Shared portal sidebar (patient, doctor, operations) */
    --tebtok-sidebar:linear-gradient(180deg,#112c4b 0%,#0b233e 64%,#081c32 100%);

    --tebtok-font:"Yekan Bakh","IRANSansX","Vazirmatn",Tahoma,Arial,sans-serif;
    color-scheme:light;
    -webkit-text-size-adjust:100%;
    text-size-adjust:100%;
}

body.crp-standalone-page,
body.crp-doctor-standalone-page,
body.crp-team-standalone-page,
body.crp-support-page,
body.crp-landing-page,
.crp-app,
.crp-doctor-app,
.crp-team-app,
.crp-support,
.crp-landing {
    font-family:var(--tebtok-font);
}

.crp-app button,.crp-app input,.crp-app select,.crp-app textarea,
.crp-doctor-app button,.crp-doctor-app input,.crp-doctor-app select,.crp-doctor-app textarea,
.crp-team-app button,.crp-team-app input,.crp-team-app select,.crp-team-app textarea,
.crp-support button,.crp-support input,.crp-support select,.crp-support textarea,
.crp-landing button,.crp-landing input,.crp-landing select,.crp-landing textarea {
    font-family:inherit;
}

/*
 * iOS zooms focused form controls when their computed size is below 16px.
 * 7.4.24 — پوشش همهٔ ریشه‌های پلاگین (پرتال‌ها با پوستهٔ tbk-app، ورود بیمار، پرداخت،
 * پنل سامانه) و همهٔ دستگاه‌های لمسی در هر عرضی، نه فقط زیر ۷۸۲ پیکسل (iPad افقی هم زوم می‌کرد).
 */
@media (max-width:782px), (hover:none) and (pointer:coarse) {
    .crp-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    .crp-app select,.crp-app textarea,
    .crp-doctor-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    .crp-doctor-app select,.crp-doctor-app textarea,
    .crp-team-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    .crp-team-app select,.crp-team-app textarea,
    .crp-system-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    .crp-system-app select,.crp-system-app textarea,
    .crp-support input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    .crp-support select,.crp-support textarea,
    .tbk-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    .tbk-app select,.tbk-app textarea,
    .crp-patient-login input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    .crp-patient-login select,.crp-patient-login textarea,
    .tbk-auth input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    .tbk-auth select,.tbk-auth textarea,
    .crp-checkout input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    .crp-checkout select,.crp-checkout textarea,
    .crp-landing input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    .crp-landing select,.crp-landing textarea {
        font-size:16px!important;
    }
    /*
     * 7.4.24 — نسخهٔ با وزن بالاتر: قاعده‌های !important دیگر با همان وزن (مثل «.sp-search select»
     * در پشتیبانی) چون دیرتر بارگذاری می‌شدند برنده می‌شدند و فیلد را ۱۳ پیکسل می‌کردند.
     * «:not(#id)» وزن شناسه اضافه می‌کند تا هیچ قاعدهٔ کلاسی نتواند آن را بشکند.
     * قاعدهٔ بالا برای مرورگرهای قدیمی‌تر که :is() را نمی‌شناسند باقی می‌ماند.
     */
    html:not(#crp-zoom-guard) :is(.crp-app,.crp-doctor-app,.crp-team-app,.crp-system-app,.crp-support,.tbk-app,.crp-patient-login,.tbk-auth,.crp-checkout,.crp-landing,.crp-admin) :is(input:not([type="checkbox"],[type="radio"],[type="range"],[type="file"],[type="hidden"],[type="submit"],[type="button"],[type="image"],[type="reset"]),select,textarea) {
        font-size:16px!important;
    }
}

/* 7.4.24 — لمس دوبارهٔ سریع روی دکمه، گزینه یا برچسب در iOS صفحه را زوم می‌کرد. */
.crp-app :is(a,button,label,summary,select,input,[role="button"]),
.crp-doctor-app :is(a,button,label,summary,select,input,[role="button"]),
.crp-team-app :is(a,button,label,summary,select,input,[role="button"]),
.crp-system-app :is(a,button,label,summary,select,input,[role="button"]),
.crp-support :is(a,button,label,summary,select,input,[role="button"]),
.tbk-app :is(a,button,label,summary,select,input,[role="button"]),
.crp-patient-login :is(a,button,label,summary,select,input,[role="button"]),
.tbk-auth :is(a,button,label,summary,select,input,[role="button"]),
.crp-checkout :is(a,button,label,summary,select,input,[role="button"]),
.crp-landing :is(a,button,label,summary,[role="button"]) {
    touch-action:manipulation;
}

/* 7.4.24 — رشته‌های بلند بدون فاصله (نام فایل، ایمیل، کد) نباید صفحه را از عرض بیرون بزنند. */
.crp-app,.tbk-app,.crp-patient-login,.tbk-auth,.crp-checkout { overflow-wrap:break-word; }
.crp-app code,.tbk-app code,.crp-checkout code { overflow-wrap:anywhere; word-break:break-word; }

@media (prefers-reduced-motion:reduce) {
    html { scroll-behavior:auto!important; }
}

/* 7.4.10 — کارت مشترک «عکس پروفایل» در پرتال‌ها */
.crp-avatar-card{margin-bottom:16px;padding:18px;border:1px solid var(--tebtok-line);border-radius:14px;background:#fff;box-shadow:var(--tebtok-shadow)}
.crp-avatar-card h2{margin:0;font-size:17px;color:var(--tebtok-ink)}
.crp-avatar-card .crp-avatar-help{margin:2px 0 0;color:var(--tebtok-muted);font-size:12.5px}
.crp-avatar-status{display:inline-block;padding:4px 11px;border-radius:999px;font-size:12px;font-weight:700}
.crp-avatar-status.is-ok{color:#166b48;background:var(--tebtok-success-soft)}
.crp-avatar-status.is-err{color:#a4302a;background:var(--tebtok-alert-soft)}
.crp-avatar-form{display:flex;flex-wrap:wrap;align-items:center;gap:14px;margin-top:14px}
.crp-avatar-preview{flex:none;display:grid;place-items:center;width:64px;height:64px;border-radius:18px;overflow:hidden;color:#fff;background:linear-gradient(145deg,var(--tebtok-blue),var(--tebtok-aqua));font-size:22px;font-weight:900}
.crp-avatar-preview img{width:100%;height:100%;object-fit:cover;display:block}
.crp-avatar-form input[type=file]{flex:1 1 220px;min-width:0;padding:9px;border:1px dashed #c6d2e2;border-radius:10px;background:#fbfdff;font-size:13px}
.crp-avatar-form button{flex:none;display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:8px 18px;border:1px solid var(--tebtok-blue);border-radius:10px;background:var(--tebtok-blue);color:#fff;font-weight:700;cursor:pointer}
.crp-avatar-form button:hover{background:var(--tebtok-blue-hover)}
@media(max-width:520px){.crp-avatar-form button{width:100%}}
/* 7.4.14: برش عکس پروفایل پیش از ذخیره */
.crp-avatar-cropper{display:grid;gap:12px;margin-top:14px;padding:14px;border:1px solid var(--tebtok-line);border-radius:14px;background:var(--tebtok-bg,#f4f7fa)}
.crp-avatar-cropper[hidden],.crp-crop-note[hidden]{display:none!important}
.crp-avatar-form .crp-avatar-remove{border-color:#e3c4c6;background:#fff;color:#b42318}
.crp-avatar-form .crp-avatar-remove:hover{background:#fff1f1}
.crp-crop-stage{position:relative;width:260px;max-width:100%;aspect-ratio:1;margin:0 auto;overflow:hidden;border-radius:14px;background:#0f1c2e;cursor:grab;touch-action:none;user-select:none;outline-offset:3px}
.crp-crop-stage.is-dragging{cursor:grabbing}
.crp-crop-stage:focus{outline:none}
.crp-crop-stage:focus-visible{outline:3px solid var(--tebtok-blue)}
.crp-crop-stage img{position:absolute;top:0;left:0;max-width:none;display:block;pointer-events:none;will-change:transform}
.crp-crop-stage::after{content:'';position:absolute;inset:0;border-radius:50%;box-shadow:0 0 0 999px rgba(15,28,46,.55);pointer-events:none}
.crp-crop-zoom{display:flex;align-items:center;gap:12px;color:var(--tebtok-muted);font-size:12.5px}
.crp-crop-zoom input{flex:1;accent-color:var(--tebtok-blue);min-height:32px}
.crp-crop-actions{display:flex;flex-wrap:wrap;gap:8px}
.crp-crop-actions button{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:8px 18px;border:1px solid var(--tebtok-line);border-radius:10px;background:#fff;color:var(--tebtok-ink);font-weight:700;cursor:pointer}
.crp-crop-actions .crp-crop-confirm{border-color:var(--tebtok-blue);background:var(--tebtok-blue);color:#fff}
.crp-crop-actions .crp-crop-confirm:hover{background:var(--tebtok-blue-hover)}
.crp-crop-hint{margin:0;color:var(--tebtok-muted);font-size:12px;line-height:1.8}
.crp-crop-note{margin:10px 0 0;padding:8px 12px;border-radius:10px;background:var(--tebtok-success-soft,#e8f8ef);color:#166b48;font-size:12.5px}
.crp-avatar-form button[disabled]{opacity:.5;cursor:not-allowed}
@media(max-width:520px){.crp-crop-actions button{flex:1 1 calc(50% - 4px)}}

/* 7.4.24 — تور ایمنی: هیچ صفحهٔ مستقل پلاگین نباید در موبایل عرض اضافه بگیرد (iOS با عرض اضافه زوم/جابه‌جایی می‌کند). */
body.crp-standalone-page,body.crp-patient-standalone-page,body.crp-doctor-standalone-page,
body.crp-team-standalone-page,body.crp-system-standalone-page,body.crp-support-page { overflow-x:clip; }
.crp-standalone-main,.crp-patient-standalone-main,.crp-doctor-standalone-main,
.crp-team-standalone-main,.crp-system-standalone-main { box-sizing:border-box; max-width:100%; }
