/*
 * ZuzuHMS Keycloak Login Theme
 * Consolidated stylesheet — all login pages share this.
 */

* {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    margin: 0;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #ffffff;
    /* Flex column centers the login block vertically on tall screens and lets
       it scroll naturally on short ones, so the footer never overlaps the form. */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    box-sizing: border-box;
}

/* ===== Page container ===== */
.login {
    width: 300px;
    max-width: 100%;
    flex: 0 0 auto;
}

.admin-logo {
    text-align: center;
    margin-bottom: 30px;
}

/* ===== Inputs ===== */
input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    margin-bottom: 10px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    outline: none;
    padding: 10px;
    font-size: 13px;
    color: #4d4d59;
    border-radius: 4px;
    box-shadow: inset 0 -5px 45px rgba(100, 100, 100, 0.2), 0 1px 1px rgba(255, 255, 255, 0.2);
    transition: box-shadow .5s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    box-shadow: inset 0 -5px 45px rgba(100, 100, 100, 0.4), 0 1px 1px rgba(255, 255, 255, 0.2);
}

/* Centered OTP input */
.otp-input {
    text-align: center;
    font-size: 18px;
    letter-spacing: 5px;
}

label {
    display: block;
    color: #4d4d59;
    font-size: 13px;
    margin-bottom: 5px;
    font-weight: normal;
}

/* ===== Primary button — HMS orange gradient ===== */
.btn-primary {
    display: block;
    width: 100%;
    padding: 9px 14px;
    font-size: 15px;
    line-height: normal;
    border-radius: 5px;
    background: #ffa84c;
    background: linear-gradient(to bottom, #ffa84c 0%, #ff7b0d 100%);
    border: 1px solid #CC4F0C;
    color: #ffffff;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.btn-primary:hover {
    background: #ff7b0d;
    border-color: #CC4F0C;
}

/* ===== Password input + eye toggle ===== */
.password-wrapper {
    position: relative;
    margin-bottom: 10px;
}

/* Cancel the password input's own bottom margin inside the wrapper — the
   wrapper owns the spacing now, otherwise we get a double gap. */
.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    margin-bottom: 0;
    padding-right: 40px; /* room for the eye button */
}

/* Edge (and legacy IE) render their own ::-ms-reveal eye next to the password
   field by default — that doubles up with our custom toggle. Suppress them so
   only the themed button shows. Other browsers ignore these pseudo-elements. */
.password-wrapper input[type="password"]::-ms-reveal,
.password-wrapper input[type="password"]::-ms-clear {
    display: none;
    width: 0;
    height: 0;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: #8a8a94;
    border-radius: 4px;
}

.password-toggle:hover {
    color: #4d4d59;
    background: rgba(0, 0, 0, 0.04);
}

.password-toggle:focus-visible {
    outline: 2px solid #ff7b0d;
    outline-offset: 2px;
    color: #4d4d59;
}

/* ===== Logout-sessions checkbox (update-password page) ===== */
.checkbox-wrapper {
    margin-bottom: 10px;
}

.checkbox-wrapper label {
    display: inline;
    font-size: 12px;
}

.checkbox-wrapper input[type="checkbox"] {
    width: auto;
    box-shadow: none;
    border: initial;
}

/* ===== Links ===== */
.forgot-pass,
.back-link {
    text-align: center;
    margin-top: 15px;
}

.forgot-pass a,
.back-link a {
    color: #4d4d59;
    font-size: 14px;
    text-decoration: none;
}

.forgot-pass a:hover,
.back-link a:hover {
    color: #333333;
    text-decoration: underline;
}

/* ===== Helper / info text ===== */
.info-text {
    color: #4d4d59;
    font-size: 13px;
    margin-bottom: 15px;
    text-align: center;
}

/* ===== Alerts ===== */
.alert-danger {
    color: #a94442;
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    padding: 15px 10px;
    margin-bottom: 20px;
    line-height: 20px;
    border-radius: 4px;
}

.alert-success,
.info-msg {
    color: #3c763d;
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    padding: 15px 10px;
    margin-bottom: 20px;
    line-height: 20px;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

/* ===== TOTP setup ===== */
.qr-code {
    text-align: center;
    margin: 15px 0;
}

.qr-code img {
    border: 1px solid #ddd;
    padding: 5px;
}

.manual-key {
    color: #4d4d59;
    font-size: 12px;
    margin-bottom: 15px;
    word-break: break-all;
    background: #f5f5f5;
    padding: 8px;
    border-radius: 4px;
}

/* ===== Social / IdP buttons ===== */
.social-providers {
    margin-top: 20px;
}

/* "or continue with" divider */
.social-divider {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    color: #8a8a94;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.social-divider::before,
.social-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
}

.social-divider span {
    padding: 0 10px;
}

.social-providers ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.social-providers li {
    margin-bottom: 8px;
}

/* Base: neutral Google-style button — icon + label, left-aligned icon. */
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 9px 14px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #3c4043;
    background: #ffffff;
    text-decoration: none;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.social-link:hover {
    background: #f7f8fa;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-right: 10px;
}

.social-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* Microsoft — per MS brand guidelines: white bg, #8c8c8c border, Segoe-ish weight. */
.social-microsoft {
    border-color: #8c8c8c;
    color: #5e5e5e;
}

/* Apple — black pill, white text and logo. */
.social-apple {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
}

.social-apple:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #ffffff;
}

/* ===== Footer ===== */
/* In-flow footer under the login block. No fixed positioning — prevents the
   overlap that happened on short viewports once the social buttons were added. */
.fake-footer {
    text-align: center;
    margin-top: 28px;
}

.fake-footer a {
    color: #4d4d59;
    font-size: 14px;
    text-decoration: none;
}

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

.privacy-policy {
    margin-top: 6px;
}
