/* -------------------------------------------------------------------------------------------
   Login chrome for the documentation gateway.

   Reproduces the layout and proportions of the reference portal at qa-mis.com/Account/Login
   (a Bootstrap "Valex"-family login screen) as a small standalone stylesheet — no Bootstrap,
   jQuery, icon font or vendor bundle required. Class names are kept identical so the markup
   reads the same as the original.
   ------------------------------------------------------------------------------------------- */

:root {
    --primary-bg-color: #8fbd56;
    --primary-bg-hover: #82c035;
    --login-bg-image: url("/_auth/img/bg-1.svg");
    --input-border: #ecf0fa;
    --body-text: #4a5568;
    --muted-text: #828996;
    --card-radius: 5px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--body-text);
    -webkit-font-smoothing: antialiased;
}

/* ---- Background ------------------------------------------------------------------------- */

.login-img {
    background-attachment: fixed !important;
    min-height: 100%;
    width: 100%;
    background: var(--login-bg-image) center / cover no-repeat, #2b3a4a;
    display: flex;
    flex-direction: column;
}

.page {
    flex: 1 0 auto;
    display: flex;
    width: 100%;
}

/* ---- Card ------------------------------------------------------------------------------- */

.container-login100 {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 15px;
    z-index: 999;
}

.wrap-login100 {
    width: 100%;
    max-width: 420px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 0 4px rgba(0, 0, 0, .14), 0 4px 8px rgba(0, 0, 0, .06);
    border-radius: var(--card-radius);
}

.wrap-login100.p-0 { padding: 0; }

.card-header {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
}

.card-header.justify-content-center { justify-content: center; }

.card-header.border-bottom { border-bottom: 1px solid var(--input-border); }

.header-brand-img {
    height: 2.5rem;
    margin: 0 auto;
    margin-top: 3px;
    display: block;
}

.card-body { padding: 1.5rem; }
.card-body.m-4 { margin: 1rem; }
.card-body.pt-6 { padding-top: 1.5rem; }
.position-relative { position: relative; }

/* ---- Inputs ----------------------------------------------------------------------------- */

.login100-form { width: 100%; }

.login100-form-title {
    font-size: 20px;
    line-height: 1.2;
    text-align: center;
    width: 100%;
    display: block;
    padding-bottom: 8px;
    color: #424344;
    font-weight: 600;
}

.login100-form-subtitle {
    display: block;
    text-align: center;
    color: var(--muted-text);
    font-size: 13px;
    padding-bottom: 22px;
}

.wrap-input100 {
    position: relative;
    width: 100%;
    z-index: 1;
    margin-bottom: 10px;
}

.wrap-input100.input-group { display: flex; }

.input100 {
    font-size: 15px;
    line-height: 1.5;
    color: #000;
    display: block;
    width: 100%;
    background: #fff;
    height: 45px;
    padding: 0 30px 0 54px;
    border-radius: var(--card-radius);
    border: 1px solid var(--input-border);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.input100::placeholder { color: var(--muted-text); opacity: 1; }

.input100:focus {
    border-color: var(--primary-bg-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-bg-color) 18%, transparent);
}

/* Right-hand "show password" toggle sits flush against the field. */
.wrap-input100.input-group .input100 {
    border-right: 0 !important;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    padding-right: 10px !important;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--input-border);
    border-left: 0 !important;
    border-top-right-radius: var(--card-radius);
    border-bottom-right-radius: var(--card-radius);
    background: #fff;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.wrap-input100.input-group:focus-within .input100,
.wrap-input100.input-group:focus-within .input-group-text { border-color: var(--primary-bg-color); }

.symbol-input100 {
    font-size: 17px;
    display: flex;
    align-items: center;
    position: absolute;
    border-radius: var(--card-radius);
    bottom: 0;
    left: 0;
    width: 44px;
    height: 45px;
    padding-left: 20px;
    pointer-events: none;
    color: var(--muted-text);
    transition: color .4s;
}

.wrap-input100:focus-within .symbol-input100 { color: var(--primary-bg-color); }

.symbol-input100 svg { width: 18px; height: 18px; }

.d-none { display: none !important; }

/* ---- Buttons ---------------------------------------------------------------------------- */

.container-login100-form-btn {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 15px;
}

.login100-form-btn {
    line-height: 1.5;
    color: #fff !important;
    width: 100%;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 25px;
    border-radius: var(--card-radius);
    border: 1px solid var(--primary-bg-color);
    background-color: var(--primary-bg-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .15s ease, opacity .15s ease;
}

.login100-form-btn:hover:not(:disabled) {
    background-color: var(--primary-bg-hover);
    border-color: var(--primary-bg-hover);
}

.login100-form-btn:disabled { cursor: not-allowed; }

.btn-link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--primary-bg-color);
    cursor: pointer;
    text-decoration: underline;
}

.opacity-50 { opacity: .5; }
.cursor-pointer { cursor: pointer; }

/* ---- Links, alerts, helpers ------------------------------------------------------------- */

a { color: var(--primary-bg-color); text-decoration: none; }
a:hover { color: var(--primary-bg-hover); }

.text-primary { color: var(--primary-bg-color); }
.text-center { text-align: center; }
.text-muted { color: var(--muted-text); }
.small { font-size: 12.5px; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: .5rem; }

.field-validation-error,
.validation-summary-errors {
    display: block;
    color: #dc3545;
    font-size: 12.5px;
    margin: -4px 0 8px;
}

.validation-summary-errors ul { list-style: none; margin: 0; padding: 0; }

.alert {
    padding: 10px 14px;
    border-radius: var(--card-radius);
    font-size: 13px;
    margin-bottom: 14px;
    border: 1px solid transparent;
}

.alert-danger { background: #fdeded; border-color: #f7c9c9; color: #a32020; }
.alert-info { background: #eef5fb; border-color: #cfe2f3; color: #245d8a; }

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin: 4px 0 6px;
}

.form-check input { accent-color: var(--primary-bg-color); width: 15px; height: 15px; }

/* ---- Two-factor enrolment --------------------------------------------------------------- */

.qr-panel {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    padding: 14px;
    border: 1px solid var(--input-border);
    border-radius: var(--card-radius);
    margin-bottom: 16px;
}

.qr-panel img { width: 168px; height: 168px; flex: none; }

.shared-key {
    font-family: SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    letter-spacing: .06em;
    background: #f6f7fb;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    padding: 8px 10px;
    word-break: break-all;
    display: block;
}

.steps { padding-left: 18px; margin: 0 0 16px; font-size: 13px; color: var(--body-text); }
.steps li { margin-bottom: 6px; }

.passcode-input {
    text-align: center;
    letter-spacing: .55em;
    font-size: 20px;
    font-family: SFMono-Regular, Consolas, monospace;
    padding-left: 30px !important;
    padding-right: 15px !important;
}


/* ---- Footer ----------------------------------------------------------------------------- */

.footer {
    background: transparent;
    font-size: 13px;
    padding: 0 1.25rem 30px;
    color: rgba(255, 255, 255, .92);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
    flex-shrink: 0;
}

.footer .text-primary { color: #fff; font-weight: 600; }

.row { display: flex; flex-wrap: wrap; }
.col-md-12, .col-sm-12 { width: 100%; }
.align-items-center { align-items: center; }
.flex-row-reverse { flex-direction: row-reverse; }

/* ---- Loader ----------------------------------------------------------------------------- */

#global-loader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    z-index: 10000;
    transition: opacity .35s ease;
}

#global-loader.hidden { opacity: 0; pointer-events: none; }

.loader-ring {
    width: 38px;
    height: 38px;
    border: 3px solid var(--input-border);
    border-top-color: var(--primary-bg-color);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.spinner-border-sm {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .loader-ring, .spinner-border-sm { animation: none; }
    #global-loader { transition: none; }
}

/* ---- Toasts ----------------------------------------------------------------------------- */

.toast-stack {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 11000;
}

.toast-item {
    min-width: 250px;
    max-width: 340px;
    padding: 12px 14px;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}

.toast-success { background: #51a351; }
.toast-warning { background: #f89406; }
.toast-error { background: #bd362f; }

/* ---- Responsive ------------------------------------------------------------------------- */

@media (max-width: 575.98px) {
    .card-body.m-4 { margin: .5rem; }
    .card-body { padding: 1.25rem 1rem; }
    .qr-panel img { width: 150px; height: 150px; }
    .recovery-codes { grid-template-columns: 1fr; }
}
