/* =========================================================
   Shared auth shell — every secondary auth page.

   Security Question (?id=securityquestion), Forgot Password
   (?id=forgetpassword), Set Password (?id=setpassword) and the
   lock screen all use this one card, so the only thing that
   differs between them is which fields they contain.

   Structure:
     logo -> title -> subtitle -> [account chip, when known]
     -> fields (label above a plain kivu-login-input)
     -> full-width submit -> footer link

   Reuses the kivu-login-* family from portal-style.css for the
   logo, title, subtitle and inputs.
   ========================================================= */

body {
    font-family: 'Inter', sans-serif;
    background: #ffffff;
    margin: 0;
}

.kivu-auth-page {
    min-height: 100vh;
    display: flex;
    /* not center: a centered card slides up when an open dropdown grows the page */
    align-items: flex-start;
    justify-content: center;
    padding: 48px 24px;
}

.kivu-auth-card {
    width: 100%;
    max-width: 468px;
    /* centered while it fits, pinned once the page has to scroll */
    margin: auto 0;
}

.kivu-auth-card .kivu-login-logo,
.kivu-auth-card .kivu-login-title,
.kivu-auth-card .kivu-login-subtitle {
    text-align: center;
}

.kivu-auth-card .kivu-login-title {
    margin-bottom: 6px;
}

.kivu-auth-card .kivu-login-subtitle {
    margin-bottom: 26px;
}

/* --- the account this page belongs to ---------------------- */

.kivu-auth-account {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    margin-bottom: 24px;
    background: #f4f9fd;
    border: 1px solid #dbe8f4;
    border-radius: 12px;
}

.kivu-auth-account-icon {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #ffffff;
    border: 1px solid #dbe8f4;
    color: var(--kivu-primary-color, #3489ca);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.kivu-auth-account-text {
    min-width: 0;
}

.kivu-auth-account-label {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #8496a8;
}

.kivu-auth-account-email {
    font-size: 14px;
    font-weight: 600;
    color: #16293d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- form -------------------------------------------------- */

.kivu-auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.kivu-auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kivu-auth-field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--kivu-text-color, #16293d);
}

.kivu-auth-field .kivu-login-input {
    padding-left: 14px;
}

/* The open panel is an overlay (position: absolute), but a tall one still grows the
   document, which slides the centered card upward. A shorter list fits in the space
   the card already has, so opening it changes nothing else on the page. */
.kivu-auth-field .single-select-dropdown {
    width: 100%;
    --ssd-list-max-height: 190px;
}

.kivu-auth-field .single-select-dropdown .kivu-search-field {
    padding: 12px 35px 12px 14px;
    min-height: auto;
    border: 1.5px solid #dde6f0;
    border-radius: 10px;
    background: #f6f9fc;
    box-shadow: none;
}

.kivu-auth-field .single-select-dropdown:not(.dropdown-disabled) .kivu-search-field:hover,
.kivu-auth-field .single-select-dropdown:not(.dropdown-disabled) .kivu-search-field:focus {
    border-color: var(--kivu-primary-color, #3489ca);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(52, 137, 202, .12);
}

.kivu-auth-field .single-select-dropdown .text {
    font-size: 14px;
    color: var(--kivu-text-color, #16293d);
}

/* password fields keep room for the reveal button */
.kivu-auth-password-wrap {
    position: relative;
}

.kivu-auth-password-wrap .kivu-login-input {
    padding-right: 44px;
}

.kivu-auth-reveal {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: #8496a8;
    border-radius: 8px;
    cursor: pointer;
}

.kivu-auth-reveal:hover {
    background: #eef4fa;
    color: #16293d;
}

.kivu-auth-hint {
    font-size: 12.5px;
    color: #8496a8;
}

/* --- submit + footer --------------------------------------- */

.kivu-auth-submit {
    width: 100%;
    margin-top: 4px;
    padding: 13px 20px;
    border: none;
    border-radius: 10px;
    background: var(--kivu-primary-color, #3489ca);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease;
}

.kivu-auth-submit:hover {
    background: #2b76b0;
}

.kivu-auth-submit:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.kivu-auth-footer {
    margin-top: 22px;
    text-align: center;
    font-size: 13.5px;
    color: #6b7f95;
}

.kivu-auth-footer a {
    color: var(--kivu-primary-color, #3489ca);
    font-weight: 600;
    text-decoration: none;
}

.kivu-auth-footer a:hover {
    text-decoration: underline;
}

/* validator icon: bottom-anchored so it centers on the 46px control regardless of
   label height — bootstrap's top:25px assumes its own 34px input.
   ((46 - 34px icon box) / 2 = 6px); line-height overrides the global 39px rule */
.kivu-auth-field.has-feedback .form-control-feedback {
    top: auto;
    bottom: 6px;
    height: 34px;
    line-height: 34px;
}

/* the validator icon would collide with the reveal button */
.kivu-auth-password-wrap .form-control-feedback {
    display: none;
}

@media (max-width: 560px) {
    .kivu-auth-page {
        padding: 28px 18px;
    }
}
