/**
 * Rezvan Theme 0.7.5.25 — UI Readability Guard
 * Project: Rezvan Platform / سامانه جامع خدام چایخانه رضوان
 * Project Lead & Implementation: Mohamad khodabakhshi / محمدکاظم خدابخشی
 *
 * Scope:
 * - Local Iran Yekan as the final typography contract.
 * - High-contrast placeholders and controls.
 * - No gold/light-gold text on white/light Caravan surfaces.
 * - Mobile-first readability without changing runtime/data contracts.
 */

:root{
    --rzv-readable-ink:#183a30;
    --rzv-readable-muted:#5d6f67;
    --rzv-readable-green:#0b513b;
    --rzv-readable-border:#cfdcd6;
    --rzv-readable-light:#fffdf8;
}

/* Final typography contract: local Iran Yekan only, with safe system fallbacks. */
html body,
html body button,
html body input,
html body select,
html body textarea,
html body .rezvan-vip-panel,
html body .rezvan-vip-panel *,
html body .rezvan-module,
html body .rezvan-module *,
html body .rzv-panel,
html body .rzv-panel *,
html body .rzv-profile-form,
html body .rzv-profile-form *{
    font-family:'IRANYekanRezvan','IRANYekan','Iran Yekan',Tahoma,Arial,sans-serif!important;
}

/* Light-surface controls: readable values and visible borders. */
html body .rezvan-vip-panel input:not([type="checkbox"]):not([type="radio"]),
html body .rezvan-vip-panel select,
html body .rezvan-vip-panel textarea,
html body .rezvan-module input:not([type="checkbox"]):not([type="radio"]),
html body .rezvan-module select,
html body .rezvan-module textarea,
html body .rzv-profile-form input:not([type="checkbox"]):not([type="radio"]),
html body .rzv-profile-form select,
html body .rzv-profile-form textarea{
    color:var(--rzv-readable-ink)!important;
    -webkit-text-fill-color:var(--rzv-readable-ink)!important;
    border-color:var(--rzv-readable-border)!important;
}

/* Placeholders must remain clearly visible, never faint/hidden. */
html body .rezvan-vip-panel input::placeholder,
html body .rezvan-vip-panel textarea::placeholder,
html body .rezvan-module input::placeholder,
html body .rezvan-module textarea::placeholder,
html body .rzv-profile-form input::placeholder,
html body .rzv-profile-form textarea::placeholder{
    color:#5f6f68!important;
    -webkit-text-fill-color:#5f6f68!important;
    opacity:1!important;
    font-weight:600!important;
}

/* Authentication is a dark surface, so its placeholder needs a light contract. */
html body .rezvan-login-form-box input::placeholder{
    color:rgba(255,255,255,.82)!important;
    -webkit-text-fill-color:rgba(255,255,255,.82)!important;
    opacity:1!important;
    font-weight:600!important;
}

/* Caravan light cards/boxes: headings and labels must be dark, never gold on white. */
html body .rezvan-caravan-module .rezvan-box,
html body .rezvan-caravan-module .rezvan-caravan-card,
html body .rezvan-caravan-module .rzv-caravan-finance-box,
html body .rezvan-caravan-module .rezvan-table td,
html body .rezvan-caravan-module .rzv-picker-popover,
html body .rezvan-caravan-module .rzv-picker-display{
    color:var(--rzv-readable-ink)!important;
}

html body .rezvan-caravan-module .rezvan-box h1,
html body .rezvan-caravan-module .rezvan-box h2,
html body .rezvan-caravan-module .rezvan-box h3,
html body .rezvan-caravan-module .rezvan-caravan-card h1,
html body .rezvan-caravan-module .rezvan-caravan-card h2,
html body .rezvan-caravan-module .rezvan-caravan-card h3,
html body .rezvan-caravan-module .rzv-caravan-finance-box > strong,
html body .rezvan-caravan-module .rzv-field-label,
html body .rezvan-caravan-module .rezvan-table th{
    color:var(--rzv-readable-green)!important;
    text-shadow:none!important;
    opacity:1!important;
}

html body .rezvan-caravan-module .rezvan-box p,
html body .rezvan-caravan-module .rezvan-box small,
html body .rezvan-caravan-module .rzv-field-help{
    color:var(--rzv-readable-muted)!important;
    opacity:1!important;
}

/* Keep the dedicated dark Caravan hero/header contract intact and readable. */
html body .rezvan-caravan-module .rezvan-module-head h1{
    color:#fff!important;
    text-shadow:0 2px 10px rgba(0,0,0,.2)!important;
}
html body .rezvan-caravan-module .rezvan-module-head p{
    color:#fff0bd!important;
    opacity:1!important;
}

/* Supervisor light surfaces: never allow pale-gold headings on a white card. */
html body .rezvan-vip-panel .rezvan-vip-card h1,
html body .rezvan-vip-panel .rezvan-vip-card h2,
html body .rezvan-vip-panel .rezvan-vip-card h3,
html body .rezvan-vip-panel .rezvan-vip-stat-card h1,
html body .rezvan-vip-panel .rezvan-vip-stat-card h2,
html body .rezvan-vip-panel .rezvan-vip-stat-card h3,
html body .rezvan-vip-panel .rezvan-vip-module-placeholder h1,
html body .rezvan-vip-panel .rezvan-vip-module-placeholder h2,
html body .rezvan-vip-panel .rezvan-vip-module-placeholder h3{
    color:var(--rzv-readable-green)!important;
    text-shadow:none!important;
    opacity:1!important;
}

/* Focus visibility for mobile/touch and keyboard use. */
html body .rezvan-vip-panel input:focus,
html body .rezvan-vip-panel select:focus,
html body .rezvan-vip-panel textarea:focus,
html body .rezvan-module input:focus,
html body .rezvan-module select:focus,
html body .rezvan-module textarea:focus,
html body .rzv-profile-form input:focus,
html body .rzv-profile-form select:focus,
html body .rzv-profile-form textarea:focus{
    outline:3px solid rgba(15,95,70,.14)!important;
    outline-offset:1px!important;
    border-color:#0f6a4e!important;
}

@media(max-width:780px){
    html body .rezvan-vip-panel input,
    html body .rezvan-vip-panel select,
    html body .rezvan-vip-panel textarea,
    html body .rezvan-module input,
    html body .rezvan-module select,
    html body .rezvan-module textarea,
    html body .rzv-profile-form input,
    html body .rzv-profile-form select,
    html body .rzv-profile-form textarea{
        min-height:46px;
        font-size:15px!important;
        line-height:1.8!important;
    }
}

/* 0.7.5.26 acceptance fix: Caravan tab strip lives on a light surface.
 * The module emits a later inline style, so these declarations intentionally
 * use !important to prevent pale-gold text from winning on white tabs. */
html body .rezvan-caravan-module .rezvan-caravan-tabs a:not(.active){
    background:#fffdf8!important;
    color:#0b513b!important;
    -webkit-text-fill-color:#0b513b!important;
    border-color:#d5e0db!important;
    text-shadow:none!important;
    opacity:1!important;
}
html body .rezvan-caravan-module .rezvan-caravan-tabs a:not(.active):hover,
html body .rezvan-caravan-module .rezvan-caravan-tabs a:not(.active):focus-visible{
    background:#edf5f1!important;
    color:#083f30!important;
    -webkit-text-fill-color:#083f30!important;
    border-color:#9fbbb0!important;
}

/* =========================================================
 * 0.7.5.49 — Supervisor Global Readability Polish
 * Surface-aware text contrast. Classes are assigned by
 * rezvan-supervisor-contrast-guard.js only inside supervisor shell.
 * No layout, data, workflow or business-logic changes.
 * ========================================================= */
html body .rezvan-vip-panel .rzv-auto-contrast-light{
    color:#36594f!important;
    -webkit-text-fill-color:#36594f!important;
    opacity:1!important;
    text-shadow:none!important;
}
html body .rezvan-vip-panel :is(h1,h2,h3,h4,h5,h6,strong,label,legend,b).rzv-auto-contrast-light{
    color:#0a513d!important;
    -webkit-text-fill-color:#0a513d!important;
    font-weight:800!important;
}
html body .rezvan-vip-panel a.rzv-auto-contrast-light{
    color:#075f49!important;
    -webkit-text-fill-color:#075f49!important;
}
html body .rezvan-vip-panel :is(p,small,span,em,li,dt,dd,td).rzv-auto-contrast-light{
    color:#425f56!important;
    -webkit-text-fill-color:#425f56!important;
}
html body .rezvan-vip-panel th.rzv-auto-contrast-light{
    color:#173f34!important;
    -webkit-text-fill-color:#173f34!important;
}

html body .rezvan-vip-panel .rzv-auto-contrast-dark{
    color:#e4f0ea!important;
    -webkit-text-fill-color:#e4f0ea!important;
    opacity:1!important;
    text-shadow:none!important;
}
html body .rezvan-vip-panel :is(h1,h2,h3,h4,h5,h6,strong,label,legend,b).rzv-auto-contrast-dark{
    color:#ffe49a!important;
    -webkit-text-fill-color:#ffe49a!important;
    font-weight:800!important;
}
html body .rezvan-vip-panel a.rzv-auto-contrast-dark{
    color:#ffe49a!important;
    -webkit-text-fill-color:#ffe49a!important;
}
html body .rezvan-vip-panel :is(p,small,span,em,li,dt,dd,td).rzv-auto-contrast-dark{
    color:#e4f0ea!important;
    -webkit-text-fill-color:#e4f0ea!important;
}
html body .rezvan-vip-panel th.rzv-auto-contrast-dark{
    color:#fff7df!important;
    -webkit-text-fill-color:#fff7df!important;
}

/* Semantic controls keep their own intentional foreground colors. */
html body .rezvan-vip-panel :is(
    button,
    .rezvan-btn,
    .rezvan-functional-button,
    .button,
    [role="button"],
    [class*="badge"],
    [class*="status"],
    [class*="chip"],
    [class*="pill"],
    [class*="tag"]
) :is(span,strong,small,b,i,em){
    color:inherit!important;
    -webkit-text-fill-color:currentColor!important;
    text-shadow:none!important;
    opacity:1!important;
}

/* Inputs remain explicitly readable regardless of surrounding surface. */
html body .rezvan-vip-panel :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
    background:#fffdf8!important;
    color:#133d33!important;
    -webkit-text-fill-color:#133d33!important;
    border-color:#8ca69b!important;
    opacity:1!important;
}
html body .rezvan-vip-panel :is(input,textarea)::placeholder{
    color:#60766d!important;
    -webkit-text-fill-color:#60766d!important;
    opacity:1!important;
}
