/* =============================================================================
   BookOn authentication pages - login, forgot password, reset password.

   Shell (every auth page):
     <body class="bo-auth-page">                         (class optional - only tints the body)
       <main class="bo-auth">
         <div class="bo-auth-art" aria-hidden="true"></div>   (CSS paints the illustration)
         <div class="bo-auth-panel">
           <div class="bo-auth-card">
             <div class="bo-auth-head"><img ...newlogo1.png alt="BookOn"><h1>Title</h1></div>
             <div class="bo-auth-body">
               .bo-alert(.bo-alert-error | -success | -info)
               .bo-field > label + .bo-input > .bo-input-icon + input.form-control (+ .bo-input-action)
               .bo-field > .bo-label-row > label + a.bo-link
               .bo-login-grid > ... .bo-field-password ... a.bo-link.bo-forgot-link (login: the
                 link is last in the markup, drawn beside the Password label - see below)
               .bo-check > input[type=checkbox] + label
               button.bo-btn (+ .bo-btn-ghost, .bo-btn-row)
               .bo-auth-foot
   Load after app.min.css / style.css / components.css so these rules win.
   ============================================================================= */

.bo-auth {
    --bo-blue: #0b57c5;
    --bo-blue-hover: #0a4cad;
    --bo-blue-active: #08419a;
    --bo-navy: #0f2547;
    --bo-text: #34425c;
    --bo-muted: #6b7a93;
    --bo-icon: #7f8ca3;
    --bo-border: #d5dfec;
    --bo-card-border: #bcd3f4;
    --bo-focus: rgba(11, 87, 197, 0.22);
    position: relative;
    display: flex;
    align-items: stretch;
    min-height: 100vh;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(135deg, #f0f6ff 0%, #e4effe 45%, #d7e7fd 100%);
    font-family: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--bo-text);
}

body.bo-auth-page {
    margin: 0;
    background: #e4effe;
}

/* Large pale curved shapes in the corners. */
.bo-auth::before,
.bo-auth::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
}

.bo-auth::before {
    width: 620px;
    height: 620px;
    top: -330px;
    left: -250px;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 80px rgba(255, 255, 255, 0.28), 0 0 0 170px rgba(255, 255, 255, 0.12);
}

.bo-auth::after {
    width: 760px;
    height: 760px;
    right: -300px;
    bottom: -440px;
    background: rgba(198, 221, 252, 0.6);
    box-shadow: 0 0 0 90px rgba(255, 255, 255, 0.3), 0 0 0 190px rgba(255, 255, 255, 0.14);
}

/* ---- left: illustration ---------------------------------------------------- */
.bo-auth-art {
    position: relative;
    flex: 1 1 52%;
    min-width: 0;
}

.bo-auth-art::before {
    content: "";
    position: absolute;
    top: 7%;
    right: 3%;
    bottom: 7%;
    left: 7%;
    background: url("../img/auth/bookon-desk.svg") center / contain no-repeat;
}

/* The illustration is painted by CSS, so an empty column is enough; anything put inside it is not shown. */
.bo-auth-art > * {
    display: none !important;
}

.bo-auth-art::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 520px;
    height: 520px;
    left: -260px;
    bottom: -300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    pointer-events: none;
}

/* ---- right: the card ------------------------------------------------------- */
.bo-auth-panel {
    position: relative;
    display: flex;
    flex: 1 1 48%;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 48px 56px 48px 24px;
}

/* A page without the illustration (e.g. a message-only page): centre the card. */
.bo-auth-panel:only-child {
    padding-right: 24px;
    padding-left: 24px;
}

.bo-auth-card {
    width: 100%;
    max-width: 470px;
    background: #ffffff;
    border: 1px solid var(--bo-card-border);
    border-radius: 18px;
    box-shadow: 0 28px 60px -28px rgba(16, 58, 125, 0.35), 0 2px 8px rgba(16, 58, 125, 0.06);
}

.bo-auth-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 28px 36px 22px;
    border-bottom: 1px solid #e3eaf4;
}

.bo-auth-head img {
    display: block;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
}

.bo-auth .bo-auth-head h1 {
    margin: 0;
    font-family: inherit;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--bo-navy);
}

.bo-auth-body {
    padding: 26px 36px 32px;
}

/* ---- fields ---------------------------------------------------------------- */
.bo-field {
    margin-bottom: 20px;
}

.bo-auth .bo-field label {
    display: block;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--bo-navy);
}

.bo-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-bottom: 8px;
}

.bo-auth .bo-label-row label {
    margin-bottom: 0;
}

/* Login: "Forgot Password?" is the LAST element of .bo-login-grid in the markup, so keyboard
   users reach it after the Login button (User Name -> Password -> show/hide -> Remember Me ->
   Login -> Forgot Password?). Grid placement draws it at the right of the Password label -
   it moves where the link is painted, never the tab order. Without grid support it simply
   sits under the Login button, right-aligned. */
.bo-auth .bo-login-grid > .bo-forgot-link {
    display: block;
    margin-top: 14px;
    text-align: right;
}

@supports (display: grid) {
    .bo-auth .bo-login-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .bo-auth .bo-login-grid > * {
        grid-column: 1 / -1;
    }

    /* Row 1 is User Name; the Password field and the link share row 2. */
    .bo-auth .bo-login-grid > .bo-field-password {
        grid-row: 2;
    }

    .bo-auth .bo-login-grid > .bo-forgot-link {
        position: relative;
        z-index: 1;
        grid-column: 2;
        grid-row: 2;
        align-self: start;
        justify-self: end;
        margin-top: 0;
        text-align: right;
    }
}

.bo-input {
    position: relative;
}

.bo-input-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    width: 18px;
    transform: translateY(-50%);
    font-size: 15px;
    line-height: 1;
    text-align: center;
    color: var(--bo-icon);
    pointer-events: none;
    transition: color 0.15s ease;
}

.bo-input:focus-within .bo-input-icon {
    color: var(--bo-blue);
}

.bo-auth .bo-input input.form-control,
.bo-auth .bo-input select.form-control {
    display: block;
    width: 100%;
    height: 50px;
    padding: 12px 16px 12px 46px;
    border: 1px solid var(--bo-border);
    border-radius: 10px;
    background-color: #ffffff;
    background-image: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--bo-navy);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Room for the button on the right (show/hide password) when there is one. */
.bo-auth .bo-input input.form-control:not(:last-child) {
    padding-right: 52px;
}

.bo-auth .bo-input input.form-control::placeholder {
    color: #9aa7bb;
    font-weight: 500;
    opacity: 1;
}

.bo-auth .bo-input input.form-control:hover {
    border-color: #b9c8dc;
}

/* style.css removes focus styles with !important; put a visible ring back. */
.bo-auth .bo-input input.form-control:focus,
.bo-auth .bo-input select.form-control:focus {
    border-color: var(--bo-blue);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px var(--bo-focus) !important;
    outline: none;
}

.bo-auth .bo-input input.form-control[aria-invalid="true"] {
    border-color: #d14343;
}

.bo-auth .bo-input input.form-control[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 4px rgba(209, 67, 67, 0.2) !important;
}

.bo-input-action {
    position: absolute;
    top: 50%;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 38px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 15px;
    color: var(--bo-icon);
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.bo-input-action:hover {
    background: #eef3fa;
    color: var(--bo-navy);
}

.bo-input-action:focus {
    outline: none;
}

.bo-input-action:focus-visible {
    outline: 2px solid var(--bo-blue);
    outline-offset: 0;
    color: var(--bo-navy);
}

/* ---- checkbox -------------------------------------------------------------- */
.bo-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0 24px;
}

.bo-auth .bo-check input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--bo-blue);
    cursor: pointer;
}

.bo-auth .bo-check input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--bo-blue);
    outline-offset: 2px;
}

.bo-auth .bo-check label {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--bo-text);
    cursor: pointer;
    user-select: none;
}

/* ---- buttons and links ----------------------------------------------------- */
.bo-auth .bo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--bo-blue);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 12px 24px -12px rgba(11, 87, 197, 0.75);
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.bo-auth .bo-btn:hover {
    background: var(--bo-blue-hover);
    color: #ffffff;
    text-decoration: none;
}

.bo-auth .bo-btn:active {
    background: var(--bo-blue-active);
    transform: translateY(1px);
}

.bo-auth .bo-btn:focus {
    outline: none;
}

.bo-auth .bo-btn:focus-visible {
    outline: 3px solid rgba(11, 87, 197, 0.4);
    outline-offset: 2px;
}

.bo-auth .bo-btn[disabled],
.bo-auth .bo-btn[aria-disabled="true"] {
    opacity: 0.7;
    cursor: progress;
    transform: none;
}

.bo-auth .bo-btn .fa-arrow-right {
    font-size: 15px;
    transition: transform 0.15s ease;
}

.bo-auth .bo-btn:hover .fa-arrow-right {
    transform: translateX(3px);
}

/* Secondary (outline) button, e.g. "Back". */
.bo-auth .bo-btn.bo-btn-ghost {
    background: #ffffff;
    border-color: var(--bo-card-border);
    color: var(--bo-blue);
    box-shadow: none;
}

.bo-auth .bo-btn.bo-btn-ghost:hover {
    background: #f1f6fe;
    color: var(--bo-blue-hover);
}

/* Two buttons side by side. */
.bo-btn-row {
    display: flex;
    gap: 12px;
}

.bo-btn-row > .bo-btn {
    flex: 1 1 0;
}

.bo-auth .bo-link {
    border-radius: 3px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--bo-blue);
    text-decoration: none;
}

.bo-auth .bo-link:hover {
    color: var(--bo-blue-hover);
    text-decoration: underline;
}

.bo-auth .bo-link:focus {
    outline: none;
}

.bo-auth .bo-link:focus-visible {
    outline: 2px solid var(--bo-blue);
    outline-offset: 2px;
}

/* ---- messages -------------------------------------------------------------- */
.bo-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.bo-alert > .fas,
.bo-alert > .far {
    flex: 0 0 auto;
    margin-top: 3px;
}

.bo-alert-error {
    background: #fdefef;
    border-color: #f2c6c6;
    color: #9f2626;
}

.bo-alert-success {
    background: #eaf8f0;
    border-color: #bfe5cd;
    color: #1b6a3d;
}

.bo-alert-info {
    background: #eaf2ff;
    border-color: #c3d8fa;
    color: #0c4596;
}

.bo-alert-close {
    flex: 0 0 auto;
    margin: -2px -4px -2px auto;
    padding: 0 6px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
}

.bo-alert-close:hover {
    opacity: 1;
}

.bo-alert-close:focus {
    outline: none;
}

.bo-alert-close:focus-visible {
    outline: 2px solid currentColor;
    opacity: 1;
}

.bo-auth-foot {
    margin: 22px 0 0;
    font-size: 13px;
    color: var(--bo-muted);
    text-align: center;
}

/* A short hint under a form (e.g. "check your junk folder"). */
.bo-auth .bo-auth-note {
    margin: 16px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--bo-muted);
}

/* Full-page "working" overlay (login page). */
.bo-auth-loading {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(228, 239, 254, 0.55);
}

.bo-auth-loading img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

/* ---- responsive ------------------------------------------------------------ */
@media (max-width: 1199.98px) {
    .bo-auth-panel {
        padding-right: 40px;
    }
}

@media (max-width: 991.98px) {
    .bo-auth-art {
        display: none;
    }

    .bo-auth-panel,
    .bo-auth-panel:only-child {
        flex: 1 1 100%;
        padding: 32px 16px;
    }

    .bo-auth-card {
        max-width: 480px;
    }
}

@media (max-width: 575.98px) {
    .bo-auth-head {
        padding: 22px 22px 18px;
    }

    .bo-auth .bo-auth-head h1 {
        font-size: 26px;
    }

    .bo-auth-body {
        padding: 22px 22px 26px;
    }

    /* 16px stops iOS zooming into the field on focus. */
    .bo-auth .bo-input input.form-control,
    .bo-auth .bo-input select.form-control {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bo-auth *,
    .bo-auth *::before,
    .bo-auth *::after {
        transition: none !important;
    }
}
