@import url("brand.css");

/* ==========================================================================
   Mostamir's Biology — Auth (Student / Admin / Installer)
   ========================================================================== */

.auth-body {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 18px 40px;
    background: var(--mb-grad-soft);
    overflow-x: hidden;
    overflow-y: auto;
}
.auth-body::before,
.auth-body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
}
.auth-body::before { width: 420px; height: 420px; background: #F7C4CA; top: -140px; left: -120px; opacity: .7; }
.auth-body::after { width: 380px; height: 380px; background: #F8E2D7; bottom: -160px; right: -110px; opacity: .8; }

.auth-topbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 24px;
    z-index: 3;
}
.auth-brand { display: flex; align-items: center; gap: 11px; }
.auth-brand img { width: 40px; height: 40px; border-radius: 12px; }
.auth-brand strong {
    display: block;
    font-family: var(--mb-font-display);
    color: var(--mb-wine-800);
    font-size: .98rem;
    line-height: 1.2;
}
.auth-brand small { color: var(--mb-muted); font-size: .74rem; }
.auth-back {
    font-size: .86rem;
    color: var(--mb-red-700);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.auth-back:hover { color: var(--mb-red-600); }

.auth-container { position: relative; z-index: 2; width: 100%; max-width: 452px; }

.auth-card {
    background: #fff;
    border: 1px solid var(--mb-line);
    border-radius: var(--mb-r-xl);
    box-shadow: var(--mb-sh-lg);
    padding: clamp(26px, 4vw, 40px);
    animation: mb-rise .5s var(--mb-ease) both;
}
.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-logo img { width: 62px; height: 62px; border-radius: 18px; margin-bottom: 14px; box-shadow: var(--mb-sh-sm); }
.auth-logo h1 { font-size: 1.5rem; margin-bottom: 4px; }
.auth-logo p { font-size: .88rem; color: var(--mb-muted); }

.auth-form .form-group { margin-bottom: 18px; }
.auth-form label { display: block; margin-bottom: 7px; font-weight: 600; font-size: .87rem; color: var(--mb-wine-700); }
.auth-form .btn { margin-top: 6px; }
.password-input-wrap { position: relative; }
.password-input-wrap > .form-control { padding-right: 50px; }
.password-visibility-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--mb-muted);
    cursor: pointer;
}
.password-visibility-toggle:hover { background: var(--mb-red-50); color: var(--mb-red-700); }
.password-visibility-toggle:focus-visible { outline: 2px solid var(--mb-red-600); outline-offset: 1px; }
.password-visibility-toggle .mb-icon { width: 19px; height: 19px; }
.password-visibility-toggle [hidden] { display: none; }

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    font-size: .86rem;
}
.auth-row a { font-weight: 500; }

.auth-note {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px 16px;
    margin-top: 22px;
    border-radius: var(--mb-r-md);
    background: var(--mb-red-50);
    border: 1px solid var(--mb-red-100);
    color: var(--mb-red-800);
    font-size: .84rem;
    line-height: 1.7;
}
.auth-note .ico { font-size: 1.05rem; line-height: 1.4; }
.auth-note strong { display: block; color: var(--mb-red-800); margin-bottom: 2px; }

.auth-foot {
    margin-top: 22px;
    text-align: center;
    font-size: .84rem;
    color: var(--mb-muted);
}
.auth-foot a { font-weight: 600; }

.install-card { max-width: 520px; }
.auth-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 20px 0;
    color: var(--mb-muted-2);
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .1em;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--mb-line); }

@media (max-width: 480px) {
    .auth-body { padding: 84px 14px 30px; }
    .auth-card { padding: 24px 18px; border-radius: var(--mb-r-lg); }
    .auth-logo h1 { font-size: 1.3rem; }
    .auth-topbar { padding: 12px 16px; }
}

.auth-credit { position: relative; z-index: 2; padding: 8px 16px 24px; text-align: center; font-size: .8rem; color: var(--mb-muted); }

/* --------------------------------------------------------- Admin sign-in */
.auth-body--admin {
    display: block;
    min-height: 100vh;
    min-height: 100svh;
    padding: 0;
    overflow-x: clip;
    background: #F5F0EC;
}
.auth-body--admin::before, .auth-body--admin::after { display: none; }
.admin-auth-page { min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; }
.admin-auth-topbar, .admin-auth-footer { width: min(100% - 48px, 1120px); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.admin-auth-topbar { min-height: 82px; }
.admin-auth-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--mb-wine-800); }
.admin-auth-brand:hover { color: var(--mb-wine-800); }
.admin-auth-brand img { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; }
.admin-auth-brand strong, .admin-auth-brand small { display: block; }
.admin-auth-brand strong { font-family: var(--mb-font-display); font-size: .92rem; line-height: 1.25; }
.admin-auth-brand small { margin-top: 2px; color: var(--mb-red-700); font-size: .62rem; font-weight: 700; letter-spacing: .12em; }
.admin-auth-topbar .auth-back { min-height: 44px; padding: 8px 10px; border-radius: var(--mb-r-xs); }
.admin-auth-topbar .auth-back:hover { background: #fff; }
.admin-auth-main { width: min(100% - 48px, 920px); margin: 0 auto; display: grid; place-items: center; padding: 18px 0 28px; }
.admin-auth-frame { width: 100%; display: grid; grid-template-columns: minmax(250px, .85fr) minmax(0, 1.15fr); overflow: hidden; border: 1px solid #EADBD4; border-radius: 20px; background: #fff; box-shadow: 0 28px 72px -42px rgba(46, 10, 18, .45), 0 8px 24px -16px rgba(46, 10, 18, .2); }
.admin-auth-aside { min-height: 510px; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(28px, 4vw, 48px); background-color: #35121C; background-image: linear-gradient(135deg, rgba(255,255,255,.035) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.035) 50%, rgba(255,255,255,.035) 75%, transparent 75%, transparent); background-size: 28px 28px; color: #fff; }
.admin-auth-eyebrow { display: inline-flex; align-items: center; gap: 9px; color: #F2B1B8; font-size: .68rem; font-weight: 700; letter-spacing: .16em; }
.admin-auth-eyebrow::before { width: 20px; height: 2px; background: #E16B79; content: ''; }
.admin-auth-aside__title h1 { max-width: 320px; margin: 0 0 6px; color: #fff; font-size: clamp(2rem, 4vw, 2.7rem); line-height: 1.08; }
.admin-auth-aside__title p { color: rgba(255,255,255,.68); font-size: .92rem; }
.admin-auth-aside__foot { display: flex; align-items: center; gap: 9px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.68); font-size: .65rem; font-weight: 700; letter-spacing: .14em; }
.admin-auth-indicator { width: 7px; height: 7px; border-radius: 50%; background: #6AC39A; box-shadow: 0 0 0 4px rgba(106,195,154,.13); }
.admin-auth-panel { align-self: center; width: 100%; max-width: 520px; margin: 0 auto; padding: clamp(32px, 5vw, 58px); }
.admin-auth-heading { margin-bottom: 30px; }
.admin-auth-heading__eyebrow { color: var(--mb-red-700); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.admin-auth-heading h2 { margin: 5px 0 5px; color: var(--mb-wine-800); font-size: 1.8rem; line-height: 1.2; }
.admin-auth-heading p { color: var(--mb-muted); font-size: .88rem; }
.admin-auth-form .form-group { margin-bottom: 20px; }
.admin-auth-form label { margin-bottom: 8px; color: var(--mb-ink); font-size: .82rem; }
.admin-auth-form .form-control { width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid #E7DAD4; border-radius: 10px; background: #FFFEFD; color: var(--mb-ink); font-size: .9rem; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.admin-auth-form .form-control::placeholder { color: #A18C86; }
.admin-auth-form .form-control:focus { outline: none; border-color: var(--mb-red-600); background: #fff; box-shadow: 0 0 0 4px rgba(192,24,47,.1); }
.admin-auth-form .btn { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; margin-top: 4px; border-radius: 10px; font-size: .92rem; font-weight: 700; }
.admin-auth-form .btn span { font-size: 1.1rem; transition: transform .18s ease; }
.admin-auth-form .btn:hover span { transform: translateX(3px); }
.admin-auth-form .btn:focus-visible, .admin-auth-topbar .auth-back:focus-visible { outline: 3px solid rgba(192,24,47,.32); outline-offset: 3px; }
.admin-auth-panel .alert { margin-bottom: 18px; overflow-wrap: anywhere; }
.admin-auth-help { margin-top: 22px; color: var(--mb-muted); font-size: .78rem; text-align: center; }
.admin-auth-footer { min-height: 62px; color: #806B66; font-size: .75rem; }
.admin-auth-footer strong { color: var(--mb-wine-700); }

@media (max-width: 680px) {
    .admin-auth-topbar, .admin-auth-footer { width: min(100% - 32px, 520px); }
    .admin-auth-topbar { min-height: 70px; }
    .admin-auth-brand strong { font-size: .82rem; }
    .admin-auth-brand img { width: 34px; height: 34px; flex-basis: 34px; }
    .admin-auth-topbar .auth-back { gap: 5px; font-size: .76rem; }
    .admin-auth-main { width: min(100% - 28px, 520px); padding: 8px 0 20px; }
    .admin-auth-frame { grid-template-columns: minmax(0, 1fr); border-radius: 16px; }
    .admin-auth-aside { min-height: 166px; padding: 20px 22px 16px; }
    .admin-auth-eyebrow { font-size: .62rem; }
    .admin-auth-aside__title h1 { margin-top: 12px; font-size: 1.55rem; }
    .admin-auth-aside__title p { font-size: .78rem; }
    .admin-auth-aside__foot { display: none; }
    .admin-auth-panel { padding: 26px 22px 24px; }
    .admin-auth-heading { margin-bottom: 22px; }
    .admin-auth-heading h2 { font-size: 1.55rem; }
    .admin-auth-form .form-group { margin-bottom: 16px; }
    .admin-auth-help { margin-top: 17px; }
    .admin-auth-footer { min-height: 54px; font-size: .68rem; }
}

@media (max-width: 360px) {
    .admin-auth-topbar, .admin-auth-footer { width: calc(100% - 24px); }
    .admin-auth-main { width: calc(100% - 20px); }
    .admin-auth-brand { gap: 7px; }
    .admin-auth-brand strong { font-size: .75rem; }
    .admin-auth-topbar .auth-back span { display: none; }
    .admin-auth-aside { min-height: 148px; padding: 18px; }
    .admin-auth-panel { padding: 22px 18px; }
}
