:root {
    --cweb-profile-radius: 10px;
    --cweb-profile-primary: #064f35;
    --cweb-profile-primary-dark: #043c28;
    --cweb-profile-text: #123026;
    --cweb-profile-muted: #6f786f;
    --cweb-profile-border: rgba(12, 58, 40, .12);
    --cweb-profile-soft: #f8f6ef;
    --cweb-profile-soft-2: #f2eee3;
    --cweb-profile-danger: #b42318;
    --cweb-profile-success: #087443;
}

.cweb-profile-container,
.cweb-profile-container *,
.cweb-profile-guest-card,
.cweb-profile-guest-card *,
.cweb-profile-notice,
.cweb-profile-notice *,
.cweb-profile-menu-btn {
    box-sizing: border-box;
}

.cweb-profile-container {
    direction: rtl;
    display: grid;
    grid-template-columns: minmax(190px, 246px) minmax(0, 1fr);
    width: min(100%, 1180px);
    margin: 20px auto;
    background: #fff;
    border: 1px solid var(--cweb-profile-border);
    border-radius: var(--cweb-profile-radius) !important;
    overflow: hidden;
    box-shadow: 0 14px 35px rgba(18, 48, 38, .08);
    color: var(--cweb-profile-text);
}

.cweb-profile-container :where(
    aside, main, section, div, form, ul, li, button, a, input, textarea, select,
    .cweb-profile-user, .cweb-profile-tabs, .cweb-profile-tab-btn,
    .cweb-profile-panel, .cweb-profile-complete-alert, .cweb-profile-edit-form,
    .cweb-profile-field, .cweb-profile-radio, .cweb-profile-readonly,
    .cweb-profile-readonly-head, .cweb-profile-info-item, .cweb-profile-notice,
    .cweb-jdate-picker, .cweb-jdate-day, .cweb-profile-save-btn
) {
    border-radius: var(--cweb-profile-radius) !important;
}

.cweb-profile-sidebar {
    background: linear-gradient(180deg, #efe8d6 0%, #f8f6ef 100%);
    padding: 18px;
    border-left: 1px solid var(--cweb-profile-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}


/* Force sidebar user card and tab buttons to share the exact same rendered width. */
.cweb-profile-sidebar > .cweb-profile-user,
.cweb-profile-sidebar > .cweb-profile-tabs,
.cweb-profile-sidebar > .cweb-profile-tabs > li,
.cweb-profile-sidebar .cweb-profile-tab-btn {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    box-sizing: border-box !important;
}

.cweb-profile-sidebar > .cweb-profile-user,
.cweb-profile-sidebar > .cweb-profile-tabs {
    align-self: stretch !important;
}

.cweb-profile-sidebar > .cweb-profile-tabs > li {
    display: flex !important;
    align-items: stretch !important;
}

.cweb-profile-sidebar .cweb-profile-tab-btn {
    flex: 1 1 auto !important;
    align-self: stretch !important;
}

.cweb-profile-user {
    width: 100%;
    min-height: 86px;
    padding: 20px 14px;
    background: #fff;
    border: 1px solid rgba(12, 58, 40, .10);
    box-shadow: 0 8px 18px rgba(18, 48, 38, .06);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.cweb-profile-user-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.cweb-profile-user strong {
    font-size: 15px;
    font-weight: 800;
    color: var(--cweb-profile-text);
}

.cweb-profile-user span {
    font-size: 13px;
    color: #9a6b14;
    font-weight: 700;
}

.cweb-profile-lock-note {
    width: 100%;
    padding: 11px 12px;
    background: #fff8e6;
    border: 1px solid rgba(180, 123, 14, .22);
    color: #7b5411;
    font-size: 12px;
    line-height: 1.9;
}

.cweb-profile-tabs {
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.cweb-profile-tabs li {
    width: 100%;
    margin: 0;
    padding: 0;
}

.cweb-profile-tab-btn,
.cweb-profile-btn,
.cweb-profile-save-btn {
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.cweb-profile-tab-btn {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    background: #fff;
    color: var(--cweb-profile-text);
    border: 1px solid rgba(12, 58, 40, .12);
    box-shadow: 0 5px 13px rgba(18, 48, 38, .05);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.cweb-profile-tab-btn:hover,
.cweb-profile-tab-btn:focus-visible {
    border-color: rgba(6, 79, 53, .35);
    box-shadow: 0 8px 18px rgba(18, 48, 38, .08);
    outline: none;
}

.cweb-profile-tab-btn.is-active {
    background: var(--cweb-profile-primary);
    border-color: var(--cweb-profile-primary);
    color: #fff;
    box-shadow: 0 9px 18px rgba(6, 79, 53, .18);
}

.cweb-profile-tab-btn.is-locked {
    opacity: .58;
    cursor: not-allowed;
}

.cweb-profile-content {
    min-width: 0;
    padding: 22px;
    background: #fff;
}

.cweb-profile-panel {
    display: none;
}

.cweb-profile-panel.is-active {
    display: block;
}

.cweb-profile-complete-alert,
.cweb-profile-notice,
.cweb-profile-edit-form,
.cweb-profile-readonly,
.cweb-profile-guest-card {
    border: 1px solid var(--cweb-profile-border);
    background: #fff;
    box-shadow: 0 8px 24px rgba(18, 48, 38, .06);
}

.cweb-profile-complete-alert {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: #fff9e8;
    border-color: rgba(180, 123, 14, .20);
    color: #72510e;
}

.cweb-profile-complete-alert strong {
    font-size: 14px;
}

.cweb-profile-complete-alert span {
    font-size: 13px;
    line-height: 1.9;
}

.cweb-profile-notice {
    padding: 12px 14px;
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.9;
}

.cweb-profile-notice-error {
    background: #fff3f0;
    border-color: rgba(180, 35, 24, .22);
    color: var(--cweb-profile-danger);
}

.cweb-profile-notice-success {
    background: #edfff6;
    border-color: rgba(8, 116, 67, .20);
    color: var(--cweb-profile-success);
}

.cweb-profile-edit-form,
.cweb-profile-readonly,
.cweb-profile-guest-card {
    padding: 18px;
}

.cweb-profile-form-grid,
.cweb-profile-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.cweb-profile-field,
.cweb-profile-info-item {
    min-width: 0;
}

.cweb-profile-field-full {
    grid-column: 1 / -1;
}

.cweb-profile-field label,
.cweb-profile-label,
.cweb-profile-info-item span {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 800;
    color: var(--cweb-profile-muted);
}

.cweb-profile-field input,
.cweb-profile-field textarea,
.cweb-profile-field select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(12, 58, 40, .15);
    background: #fff;
    color: var(--cweb-profile-text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.cweb-profile-field textarea {
    min-height: 88px;
    resize: vertical;
}

.cweb-profile-field input:focus,
.cweb-profile-field textarea:focus,
.cweb-profile-field select:focus {
    border-color: rgba(6, 79, 53, .55);
    box-shadow: 0 0 0 3px rgba(6, 79, 53, .08);
}

.cweb-profile-field.has-error input,
.cweb-profile-field.has-error textarea,
.cweb-profile-field.has-error select,
.cweb-profile-field.has-client-error input,
.cweb-profile-field.has-client-error textarea,
.cweb-profile-field.has-client-error select {
    border-color: rgba(180, 35, 24, .78);
    background: #fff7f6;
    box-shadow: 0 0 0 3px rgba(180, 35, 24, .08);
}

.cweb-profile-field.has-client-error .cweb-profile-radio-row {
    padding: 8px;
    border: 1px solid rgba(180, 35, 24, .55);
    background: #fff7f6;
    border-radius: var(--cweb-profile-radius) !important;
}

.cweb-profile-field.has-client-error .cweb-profile-radio {
    border-color: rgba(180, 35, 24, .28);
    background: #fff;
}

.cweb-profile-field-error,
.cweb-profile-client-error {
    display: block;
    margin-top: 6px;
    color: var(--cweb-profile-danger);
    font-size: 12px;
    line-height: 1.8;
}

.cweb-profile-radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cweb-profile-radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(12, 58, 40, .13);
    background: var(--cweb-profile-soft);
    cursor: pointer;
}

.cweb-profile-radio input {
    width: auto;
    min-height: auto;
}

.cweb-profile-help {
    margin: 14px 0 0;
    color: var(--cweb-profile-muted);
    font-size: 12px;
    line-height: 1.9;
}

.cweb-profile-save-btn,
.cweb-profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    margin-top: 14px;
    border: 1px solid var(--cweb-profile-primary);
    background: var(--cweb-profile-primary);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
}

.cweb-profile-save-btn:hover,
.cweb-profile-btn:hover {
    background: var(--cweb-profile-primary-dark);
    color: #fff;
}

.cweb-profile-save-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.cweb-profile-readonly-head {
    padding: 14px;
    margin-bottom: 14px;
    background: var(--cweb-profile-soft);
    border: 1px solid rgba(12, 58, 40, .10);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cweb-profile-readonly-head strong {
    color: var(--cweb-profile-text);
}

.cweb-profile-readonly-head span {
    color: var(--cweb-profile-muted);
    font-size: 13px;
    line-height: 1.8;
}

.cweb-profile-info-item {
    padding: 12px;
    border: 1px solid rgba(12, 58, 40, .11);
    background: #fff;
}

.cweb-profile-info-item strong {
    display: block;
    color: var(--cweb-profile-text);
    font-size: 14px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.cweb-profile-guest-card {
    direction: rtl;
    width: min(100%, 560px);
    margin: 24px auto;
    text-align: center;
}

.cweb-profile-guest-card p {
    margin: 0;
    line-height: 1.9;
    color: var(--cweb-profile-text);
}

.cweb-profile-actions {
    margin-top: 12px;
}

.cweb-profile-menu-btn {
    display: none;
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 9999;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(12, 58, 40, .14);
    background: #fff;
    color: var(--cweb-profile-primary);
    box-shadow: 0 10px 24px rgba(18, 48, 38, .16);
    font-size: 20px;
    line-height: 1;
}


.cweb-jdate-picker {
    position: fixed;
    z-index: 999999;
    width: 292px;
    padding: 10px;
    color: var(--cweb-profile-text);
    background: #ffffff;
    border: 1px solid var(--cweb-profile-border);
    border-radius: var(--cweb-profile-radius) !important;
    box-shadow: 0 14px 36px rgba(18, 48, 38, .18);
    direction: rtl;
}

.cweb-jdate-picker[hidden] {
    display: none !important;
}

.cweb-jdate-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.cweb-jdate-head button,
.cweb-jdate-days button {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 0;
    margin: 0;
    font: inherit;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    box-shadow: none;
    cursor: pointer;
}

.cweb-jdate-head button {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    color: var(--cweb-profile-primary);
    background: var(--cweb-profile-soft);
    border: 1px solid var(--cweb-profile-border);
    border-radius: var(--cweb-profile-radius) !important;
}

.cweb-jdate-head button:hover {
    color: #ffffff;
    background: var(--cweb-profile-primary);
    border-color: var(--cweb-profile-primary);
}

.cweb-jdate-title {
    flex: 1;
    appearance: none;
    -webkit-appearance: none;
    min-height: 34px;
    padding: 0 8px !important;
    color: var(--cweb-profile-primary);
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
    background: transparent;
    border: 0;
    border-radius: var(--cweb-profile-radius) !important;
    cursor: pointer;
}

.cweb-jdate-month-trigger:hover,
.cweb-jdate-year-trigger:hover {
    background: var(--cweb-profile-soft);
}

.cweb-jdate-week,
.cweb-jdate-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.cweb-jdate-week span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    color: rgb(255, 109, 1);
    text-align: center;
    font-size: 12px;
    font-weight: 800;
}

.cweb-jdate-days button {
    width: 100%;
    min-height: 34px;
    color: var(--cweb-profile-text);
    background: #ffffff;
    border: 0;
    border-radius: var(--cweb-profile-radius) !important;
}

.cweb-jdate-days button:hover {
    color: var(--cweb-profile-primary);
    background: rgba(255, 109, 1, .10);
}

.cweb-jdate-days button.is-selected {
    color: #ffffff;
    background: var(--cweb-profile-primary);
}

.cweb-jdate-days span {
    min-height: 34px;
}

.cweb-jdate-months,
.cweb-jdate-years {
    display: grid;
    gap: 6px;
}

.cweb-jdate-months {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cweb-jdate-years {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-height: 260px;
    overflow-y: auto;
    padding-left: 4px;
}

.cweb-jdate-months button,
.cweb-jdate-years button {
    appearance: none;
    -webkit-appearance: none;
    min-height: 38px;
    padding: 0 6px;
    color: var(--cweb-profile-text);
    font: inherit;
    background: #ffffff;
    border: 1px solid var(--cweb-profile-border);
    border-radius: var(--cweb-profile-radius) !important;
    cursor: pointer;
}

.cweb-jdate-months button:hover,
.cweb-jdate-years button:hover {
    color: var(--cweb-profile-primary);
    background: rgba(255, 109, 1, .10);
    border-color: rgba(255, 109, 1, .35);
}

.cweb-jdate-months button.is-selected,
.cweb-jdate-years button.is-selected {
    color: #ffffff;
    background: var(--cweb-profile-primary);
    border-color: var(--cweb-profile-primary);
}

.cweb-profile-field:has(.cweb-jdate-input) {
    position: relative;
}

.cweb-profile-jdate-picker.cweb-jdate-picker.is-body-picker {
    position: fixed !important;
}

.cweb-jdate-input {
    cursor: pointer;
}

@media (max-width: 782px) {
    .cweb-profile-container {
        grid-template-columns: 1fr;
        margin: 14px auto;
    }

    .cweb-profile-sidebar {
        border-left: 0;
        border-bottom: 1px solid var(--cweb-profile-border);
    }

    .cweb-profile-content {
        padding: 16px;
    }

    .cweb-profile-form-grid,
    .cweb-profile-info-grid {
        grid-template-columns: 1fr;
    }

    .cweb-profile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .cweb-jdate-picker {
        width: calc(100vw - 16px) !important;
        left: 8px !important;
        right: auto !important;
    }
}


/* v1.1.8: دقیق‌سازی تراز افقی منوی کناری با باکس خوش‌آمدگویی.
   بعضی قالب‌ها/المنتور روی ul و button ها padding-inline یا max-width می‌گذارند؛
   این قانون‌ها فقط داخل افزونه اعمال می‌شوند و عرض رندر شده را یکسان نگه می‌دارند. */
.cweb-profile-container .cweb-profile-sidebar {
    align-items: stretch !important;
}

.cweb-profile-container .cweb-profile-sidebar > .cweb-profile-user,
.cweb-profile-container .cweb-profile-sidebar > .cweb-profile-lock-note,
.cweb-profile-container .cweb-profile-sidebar > .cweb-profile-tabs {
    display: flex !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    align-self: stretch !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    box-sizing: border-box !important;
}

.cweb-profile-container .cweb-profile-sidebar > .cweb-profile-tabs {
    flex-direction: column !important;
    gap: 9px !important;
    padding: 0 !important;
    padding-inline-start: 0 !important;
    padding-inline-end: 0 !important;
    margin: 4px 0 0 !important;
    list-style: none !important;
}

.cweb-profile-container .cweb-profile-sidebar > .cweb-profile-tabs > li {
    display: flex !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
    padding-inline-start: 0 !important;
    padding-inline-end: 0 !important;
    margin: 0 !important;
    margin-inline-start: 0 !important;
    margin-inline-end: 0 !important;
    list-style: none !important;
    box-sizing: border-box !important;
}

.cweb-profile-container .cweb-profile-sidebar > .cweb-profile-tabs > li > .cweb-profile-tab-btn {
    display: flex !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: 1 1 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    margin-inline-start: 0 !important;
    margin-inline-end: 0 !important;
}


/* v1.1.9: نمایش خطای لحظه‌ای بعد از خروج کاربر از فیلدهای ناقص/نامعتبر. */
.cweb-profile-field.is-touched.has-client-error label,
.cweb-profile-field.is-touched.has-client-error .cweb-profile-label {
    color: var(--cweb-profile-danger);
}
