/* True Self theme for the therapist portal. Loaded after the Metronic build from app.blade.php.
   Green = the "Book Now" button on trueselfcounselling.ca (#007E52, hover #007149). */
html:root,
html[data-bs-theme=light],
html[data-bs-theme=dark] {
    --bs-primary: #007E52 !important;
    --bs-primary-rgb: 0, 126, 82 !important;
    --bs-primary-active: #007149 !important;
    --bs-primary-light: #E6F2ED !important;
    --bs-primary-inverse: #ffffff !important;
    --bs-primary-bg-subtle: #CCE5DC !important;
    --bs-primary-border-subtle: #99CBBA !important;
    --bs-primary-text-emphasis: #00402A !important;
    --bs-text-primary: #007E52 !important;
    --bs-link-color: #007E52 !important;
    --bs-link-color-rgb: 0, 126, 82 !important;
    --bs-link-hover-color: #007149 !important;
    --bs-link-hover-color-rgb: 0, 113, 73 !important;
}

html[data-bs-theme=dark] {
    --bs-primary-light: #12302A !important;
}

.btn-primary {
    --bs-btn-bg: #007E52 !important;
    --bs-btn-border-color: #007E52 !important;
    --bs-btn-hover-bg: #007149 !important;
    --bs-btn-hover-border-color: #007149 !important;
    --bs-btn-active-bg: #007149 !important;
    --bs-btn-active-border-color: #007149 !important;
    --bs-btn-color: #fff !important;
    --bs-btn-hover-color: #fff !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #99CBBA !important;
    box-shadow: 0 0 0 .2rem rgba(0, 126, 82, .15) !important;
}

.form-check-input:checked {
    background-color: #007E52 !important;
    border-color: #007E52 !important;
}

.nav-pills {
    --bs-nav-pills-link-active-bg: #007E52 !important;
}

.page-item.active .page-link,
.pagination .page-item.active .page-link {
    background-color: #007E52 !important;
    border-color: #007E52 !important;
    color: #fff !important;
}

/* Actions menu rows */
.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #E6F2ED !important;
    color: #007149 !important;
}

/* SweetAlert pop-ups (Edit Payment link, delete confirm, etc.) */
.swal2-styled.swal2-confirm {
    background-color: #007E52 !important;
}
.swal2-styled.swal2-confirm:hover {
    background-color: #007149 !important;
}
.swal2-styled.swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(0, 126, 82, .35) !important;
}

/* Each therapist's own headshot instead of the template's stock avatar.
   --tsp-avatar is set per page in app.blade.php to that therapist's own file, so every therapist
   has a different URL and no cache can ever show one therapist's photo for another. */
img[src$="media/avatars/300-1.jpg"] {
    object-position: -9999px 0 !important;
    background: #F7F2EF var(--tsp-avatar, url("/card-assets/therapists/_default.jpg")) center / cover no-repeat !important;
}

/* Account menu (top right): long emails used to run out of the white box. Widen it a little
   and let the email wrap instead. */
.menu-sub-dropdown:has(a[href="/account/password"]) {
    width: 320px !important;
    max-width: calc(100vw - 32px);
}
.menu-sub-dropdown:has(a[href="/account/password"]) .menu-content > .d-flex.flex-column {
    min-width: 0;
}
.menu-sub-dropdown:has(a[href="/account/password"]) .menu-content a.fs-7 {
    overflow-wrap: anywhere;
}

/* No light/dark/system switcher: the portal is always light. */
div:has(> [data-kt-element="theme-mode-menu"]),
[data-kt-element="theme-mode-menu"] {
    display: none !important;
}

/* ---------- Type: trueselfcounselling.ca fonts, darker and slightly larger text ---------- */
html {
    font-size: 14px !important;
}
html:root,
html[data-bs-theme=light] {
    --bs-font-sans-serif: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif !important;
    --bs-body-font-family: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif !important;
    --bs-body-color: #2E2B28 !important;
    --bs-gray-500: #8A847D !important;
    --bs-gray-600: #6A645E !important;
    --bs-gray-700: #4C4741 !important;
    --bs-gray-800: #2E2B28 !important;
    --bs-gray-900: #1F1D1B !important;
    --bs-text-muted: #6A645E !important;
    --bs-text-gray-600: #6A645E !important;
    --bs-text-gray-700: #4C4741 !important;
    --bs-text-gray-800: #2E2B28 !important;
}
body {
    font-family: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif !important;
}
h1, h2, h3, .modal-title, .swal2-title, .card-title h2, .card-title h3 {
    font-family: "Frank Ruhl Libre", Georgia, serif !important;
    font-weight: 500 !important;
}
.table, .dataTable {
    font-size: 1rem !important;
}
.table th, .dataTable th {
    color: #6A645E !important;
    letter-spacing: .04em;
}
.table td, .dataTable td {
    color: #2E2B28 !important;
}
.dropdown-item .fs-8 {
    font-size: .95rem !important;
}

/* ---------- One "Client Search" box (server searches name and email) ---------- */
.card-title .col-md-6:has(input[placeholder="Search By Email"]) {
    display: none !important;
}
.card-title .col-md-6:has(input[placeholder="Client Search"]) {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}
input[placeholder="Client Search"] {
    width: 340px !important;
    max-width: 100%;
}

/* ---------- Sign-in page: beige TrueSelf pattern, gold logo, dark heading ---------- */
[style*="auth-bg.png"] {
    background-image: url("/card-assets/auth-bg-beige.png") !important;
}
[style*="auth-bg.png"] img {
    object-position: -9999px 0 !important;
    background: url("/card-assets/tsc-mark-gold.png") center / contain no-repeat !important;
}
[style*="auth-bg.png"] h1 {
    color: #2E2B28 !important;
}

/* ---------- Sign-in page redesign: one calm centred card (overrides the split template) ---------- */
body:has([style*="auth-bg.png"]) {
    background: #F4EEE7 !important;
}
.flex-lg-row:has(> [style*="auth-bg.png"]) {
    min-height: 100vh;
    background:
        url("/card-assets/tsc-mark-watermark.png") right -140px bottom -120px / 620px auto no-repeat,
        radial-gradient(circle at 15% 10%, #FFFFFF 0, rgba(255, 255, 255, 0) 45%),
        radial-gradient(circle at 90% 95%, #EADFD1 0, rgba(234, 223, 209, 0) 50%),
        #F4EEE7 !important;
}
html body div.d-flex[style*="auth-bg.png"] {
    display: none !important;
}
html body .flex-lg-row:has(> [style*="auth-bg.png"]) > div.d-flex.w-lg-50.order-lg-1 {
    width: 100% !important;
    background: transparent !important;
}
.w-lg-500px:has(> form) {
    width: 100% !important;
    max-width: 480px;
    padding: 44px 40px 36px !important;
    background: #FFFFFF;
    border: 1px solid #E6DDD2;
    border-radius: 22px;
    box-shadow: 0 24px 60px -24px rgba(77, 55, 33, .25), 0 2px 6px rgba(77, 55, 33, .05);
}
.w-lg-500px:has(> form)::before {
    content: "";
    display: block;
    width: 86px;
    height: 82px;
    margin: 0 auto 18px;
    background: url("/card-assets/tsc-mark-gold.png") center / contain no-repeat;
}
.w-lg-500px:has(> form)::after {
    content: "Need help signing in? Contact the True Self admin team.";
    display: block;
    margin-top: 22px;
    text-align: center;
    font-size: 1rem;
    color: #8A847D;
}
.w-lg-500px > form .text-center.mb-10 {
    margin-bottom: 28px !important;
}
.w-lg-500px > form .text-center.mb-10 h1 {
    font-size: 0 !important;
    margin: 0 !important;
}
.w-lg-500px > form .text-center.mb-10 h1::before {
    content: "Payment Portal";
    display: block;
    font: 500 2.5rem/1.15 "Frank Ruhl Libre", Georgia, serif;
    color: #2E2B28;
}
.w-lg-500px > form .text-center.mb-10::after {
    content: "Therapist sign in \00B7  True Self Counselling";
    display: block;
    margin-top: 10px;
    font-size: 1.15rem;
    color: #6A645E;
}
.w-lg-500px > form .fv-row {
    margin-bottom: 20px !important;
}
.w-lg-500px > form .form-label {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #4C4741 !important;
}
.w-lg-500px > form .form-control {
    background: #FAF7F2 !important;
    border: 1px solid #E4DDD2 !important;
    border-radius: 12px !important;
    padding: 15px 16px !important;
    font-size: 1.15rem !important;
    color: #2E2B28 !important;
}
.w-lg-500px > form .form-control:focus {
    background: #FFFFFF !important;
    border-color: #007E52 !important;
    box-shadow: 0 0 0 4px rgba(0, 126, 82, .12) !important;
}
.w-lg-500px > form .btn-primary {
    margin-top: 8px;
    border-radius: 12px !important;
    padding: 14px !important;
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    letter-spacing: .01em;
}
.w-lg-500px > form .btn-primary .indicator-label {
    font-size: 0 !important;
}
.w-lg-500px > form .btn-primary .indicator-label::after {
    content: "Sign in";
    font-size: 1.2rem;
}
.w-lg-500px > form .btn-primary:not(:disabled) .indicator-progress {
    display: none;
}
