/* ============================================================================
   MedPath Global (Mbbs theme) — bridge stylesheet
   ----------------------------------------------------------------------------
   style.css is the designer's template and owns the whole visual language.
   This file only supplies the handful of Bootstrap-flavoured classes that the
   shared partials (Frontend.auth.loginregister, Frontend.layouts.message,
   Default/Frontend/js/custom.js) emit, so we can reuse them without loading
   Bootstrap's stylesheet and having it fight the template.
   ========================================================================= */

/* --- Registration / login / forgot panels ------------------------------- */
#loginregister .form-flex {
    display: block;
}

#loginregister .btn-link {
    display: block;
    width: 100%;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0.5rem 0;
    color: var(--secondary);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
}

#loginregister .btn-link:hover {
    color: var(--secondary-hover);
    text-decoration: underline;
    transform: none;
}

/* loginregister ships value="Submit" inputs with .btn-warning.btn-block —
   render them as the template's primary button. */
#loginregister .btn-warning,
#loginregister input[type="submit"].btn {
    background-color: var(--secondary);
    color: var(--bg-white);
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}

#loginregister .btn-warning:hover,
#loginregister input[type="submit"].btn:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.6);
}

#loginregister .btn-block {
    display: block;
    width: 100%;
}

/* --- Phone number + country code input group ---------------------------- */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
}

.input-group-prepend {
    display: flex;
    flex: 0 0 auto;
    max-width: 45%;
}

.input-group > .form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group .input-group-prepend .form-control,
.input-group .input-group-prepend .select2-container {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .form-control:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
}

.img-flag {
    height: 0.9em;
    margin-right: 0.35rem;
    vertical-align: baseline;
}

/* Hide the number spinner so the phone field matches the template inputs. */
.phonewithcountrycode input[type="number"]::-webkit-outer-spin-button,
.phonewithcountrycode input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.phonewithcountrycode input[type="number"] {
    -moz-appearance: textfield;
}

/* --- select2 sized to the template's .form-control ---------------------- */
.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--single {
    height: auto;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-white);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.2;
    padding: 0;
    color: var(--text-main);
    font-size: 0.95rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    top: 0;
    right: 0.5rem;
}

.select2-container--open .select2-dropdown {
    border-color: var(--secondary);
    z-index: 2100;
}

/* --- Consent checkbox --------------------------------------------------- */
#loginregister .form-group.agrCheck {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1rem;
    font-weight: 400;
    cursor: pointer;
}

#loginregister .form-group.agrCheck .form-control {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    padding: 0;
    margin-top: 0.2rem;
    order: -1;
}

#loginregister .form-group.agrCheck .checkText {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-muted);
}

/* --- Validation feedback ------------------------------------------------ */
.is-invalid {
    border-color: #dc2626 !important;
}

.invalid-feedback,
label.error {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: #dc2626;
}

/* --- Minimal grid used by the optional captcha block -------------------- */
#loginregister .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

#loginregister .row > [class^="col-md-"] {
    padding: 0 0.5rem;
}

#loginregister .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
#loginregister .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
#loginregister .col-md-12 { flex: 0 0 100%; max-width: 100%; }

#loginregister .captcha {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#loginregister .refresh_captcha {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--secondary);
}

/* --- Alerts (walk-in notice in the hero) -------------------------------- */
.alert {
    position: relative;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
}

.alert-danger {
    color: #7f1d1d;
    background-color: #fee2e2;
    border-color: #fecaca;
}

.alert .alert-heading {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: inherit;
}

.alert ul {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.875rem;
}

.alert-dismissible {
    padding-right: 3rem;
}

.alert-dismissible .close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.9rem 1.15rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}

.alert-dismissible .close:hover {
    opacity: 1;
}

.fade:not(.show) {
    opacity: 0;
}

/* --- Toasts emitted by showAlert() in Default/Frontend/js/custom.js ----- */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 999999999;
}

#toast-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#toast-wrapper .toast {
    min-width: 18rem;
    max-width: 22rem;
    overflow: hidden;
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    transition: opacity 0.25s linear;
}

#toast-wrapper .toast.showing,
#toast-wrapper .toast.show {
    opacity: 1;
}

#toast-wrapper .toast:not(.show):not(.showing) {
    display: none;
}

#toast-wrapper .toast-header {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
}

#toast-wrapper .toast-body {
    padding: 0.75rem 0.9rem;
    font-size: 0.85rem;
    color: var(--text-main);
}

#toast-wrapper .toast-body ul {
    margin: 0;
    padding-left: 1.1rem;
}

#toast-wrapper .mr-auto { margin-right: auto; }
#toast-wrapper .ml-2 { margin-left: 0.5rem; }
#toast-wrapper .mb-1 { margin-bottom: 0.25rem; }

#toast-wrapper .close {
    background: none;
    border: none;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
}

#toast-wrapper .bg-success { background-color: var(--success); }
#toast-wrapper .bg-danger  { background-color: #dc2626; }
#toast-wrapper .bg-warning { background-color: var(--accent); }
#toast-wrapper .bg-info    { background-color: var(--secondary); }
#toast-wrapper .text-white { color: #fff; }
#toast-wrapper .text-muted { color: rgba(255, 255, 255, 0.75); }

/* --- progressIndicator() overlay --------------------------------------- */
.d-none { display: none !important; }

.ctplloader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    background-color: rgba(15, 43, 70, 0.65);
    border-radius: var(--radius-lg);
    z-index: 2200;
}

.ctplloader .loadercont {
    text-align: center;
    color: #fff;
}

/* --- Signed-in top bar ------------------------------------------------- */
.mbbs-userbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.mbbs-userbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.mbbs-userbar .logo,
.mbbs-userbar .logo span {
    color: #fff;
}

/*
 * This bar is dark and the logo artwork has an opaque white background, so the
 * logo sits on a white chip rather than showing as a bare white square.
 */
.mbbs-userbar .logo {
    background: #fff;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
}

.mbbs-userbar .logo img {
    display: block;
    height: 44px;
    width: auto;
}

@media (max-width: 480px) {
    .mbbs-userbar .logo img {
        height: 36px;
    }
}

.mbbs-userbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mbbs-userbar-name {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    font-weight: 500;
}

.mbbs-userbar .btn {
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.mbbs-userbar .btn-ghost {
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.mbbs-userbar .btn-ghost:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 640px) {
    .mbbs-userbar .container {
        flex-wrap: wrap;
    }

    .mbbs-userbar-name {
        display: none;
    }
}

/* --- Modal holding the registration form ------------------------------- */
#consultationModal .modal-content {
    max-height: 92vh;
    overflow-y: auto;
    padding: 1.25rem;
}

#consultationModal .modal-content > h3 {
    padding-right: 2.5rem;
}

/* --- Error page -------------------------------------------------------- */
.mbbs-error-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 8rem 0 4rem;
}

.mbbs-error-card {
    max-width: 32rem;
    width: 100%;
    text-align: center;
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 3rem 2rem;
}

.mbbs-error-card .mbbs-error-icon {
    font-size: 3rem;
    color: #dc2626;
    margin-bottom: 1.25rem;
}

/* --- Mobile ------------------------------------------------------------ */
/* style.css owns the responsive layer for everything the template renders.
   The rules below cover only what this bridge file introduces, and the few
   places where its higher-specificity selectors would otherwise beat the
   template's own mobile rules (custom.css is loaded after style.css). */

@media (max-width: 767.98px) {
    /* Beats style.css's .modal-content mobile padding on specificity. */
    #consultationModal .modal-content {
        padding: 1.75rem 1.25rem;
        max-height: 90vh;
    }

    #consultationModal .modal-content > h3 {
        padding-right: 2rem;
    }

    /* The captcha row is the only two-column block in the form; side by side
       it leaves the image and the input too narrow to use on a phone. */
    #loginregister .col-md-5,
    #loginregister .col-md-7 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    #loginregister .captcha {
        margin-bottom: 0.75rem;
    }

    /* The country-code select cannot give up more than a third of the row and
       still show a dial code. */
    .input-group-prepend {
        max-width: 40%;
    }

    #toast-container {
        left: 0.75rem;
        right: 0.75rem;
        top: 0.75rem;
    }

    #toast-wrapper .toast {
        min-width: 0;
        max-width: none;
    }

    .mbbs-error-section {
        min-height: 50vh;
        padding: 6.5rem 0 3rem;
    }

    .mbbs-error-card {
        padding: 2rem 1.25rem;
    }

    .mbbs-error-card .mbbs-error-icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    /* Signed-in bar: logo + Dashboard + Logout on a narrow row. */
    .mbbs-userbar .container {
        gap: 0.5rem;
    }

    .mbbs-userbar .logo {
        font-size: 1.05rem;
    }

    .mbbs-userbar .btn {
        padding: 0.45rem 0.7rem;
        font-size: 0.78rem;
    }

    .mbbs-userbar-actions {
        gap: 0.5rem;
    }

    .alert {
        padding: 0.85rem 1rem;
    }

    .alert-dismissible {
        padding-right: 2.5rem;
    }
}
