/* ============================================================
   LOGIN — "Bedside Patient Management" reference match.
   Full-bleed, softly-faded hospital photo behind a light hero
   (logo, headline, feature strip) with a floating white card
   anchored on the right. Fully responsive: desktop / laptop /
   tablet / mobile.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

* {
    box-sizing: border-box;
}

html, body.login-body {
    height: 100%;
    margin: 0;
}

body.login-body {
    font-family: var(--font-body);
    color: var(--ink);
    background: #f7f9fc;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

#loginForm {
    width: 100% !important;
    display: block;
}

/* ================= Ambient backdrop ================= */
.dot-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 340px;
    height: 340px;
    z-index: 0;
    pointer-events: none;
    opacity: .5;
    background-image: radial-gradient(circle, #b9c4d6 1.4px, transparent 1.4px);
    background-size: 20px 20px;
    -webkit-mask-image: radial-gradient(circle at 0 0, #000 55%, transparent 100%);
    mask-image: radial-gradient(circle at 0 0, #000 55%, transparent 100%);
}

.hero-bg-photo {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: linear-gradient(90deg,rgba(255, 255, 255, 1) 17%, rgba(87, 199, 133, 0) 100%, rgba(237, 221, 83, 0) 100%), url('/Images/BG.png');
    background-size: cover;
    background-position: center;
    filter: saturate(.85);
}

/* ================= Page shell ================= */
.login-page {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    opacity: 0;
    animation: page-in .6s var(--ease) .05s forwards;
}

@keyframes page-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ================= LEFT: hero ================= */
.login-hero {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 48px clamp(24px, 5vw, 80px);
}

.hero-inner {
    max-width: 620px;
}

.hero-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 34px;
}

.hero-brand-icon {
    height: 52px;
    width: auto;
    display: block;
}

.hero-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

    .hero-brand-text strong {
        font-size: 21px;
        font-weight: 800;
        color: var(--teal-500);
        letter-spacing: .01em;
    }

    .hero-brand-text span {
        font-size: 11.5px;
        font-weight: 600;
        color: var(--ink-soft);
        letter-spacing: .06em;
    }

.hero-title {
    margin: 0 0 18px;
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: clamp(30px, 3.6vw, 44px);
    line-height: 1.12;
    color: var(--ink);
    letter-spacing: -.01em;
}

    .hero-title span {
        color: var(--teal-500);
    }

.hero-title-big {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(38px, 4.6vw, 58px);
    letter-spacing: -.01em;
    margin-bottom: 10px;
}

    .hero-title-big span {
        color: var(--aurora-2);
        display: block;
        font-size: 0.62em;
    }

.hero-tagline {
    margin: 0 0 20px;
    font-size: 17px;
    font-weight: 700;
    color: var(--ink-soft);
}

.hero-rule {
    width: 74px;
    height: 4px;
    border-radius: 4px;
    margin-bottom: 22px;
    background: linear-gradient(90deg, var(--aurora-2), var(--line));
}

.hero-sub {
    margin: 0 0 40px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink-soft);
    max-width: 460px;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 22px;
    max-width: 520px;
}

.hf-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

    .hf-item svg {
        width: 34px;
        height: 34px;
        color: var(--teal-500);
        flex-shrink: 0;
    }

        .hf-item svg .hf-accent {
            color: var(--aurora-2);
        }

    .hf-item span {
        font-size: 12.5px;
        font-weight: 600;
        line-height: 1.35;
        color: var(--ink-soft);
    }

/* ================= RIGHT: floating card ================= */
.login-card-wrap {
    flex: none;
    width: min(580px, 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 96px 40px 8px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(20,30,60,.14), 0 4px 16px rgba(20,30,60,.08);
    padding: 40px 40px 34px;
    opacity: 0;
    transform: translateY(16px);
    animation: card-in .6s var(--ease) .15s forwards;
}

@keyframes card-in {
    to {
        opacity: 1;
        transform: none;
    }
}

.card-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 4px;
}

.card-brand-icon {
    height: 66px;
    width: auto;
    margin-bottom: 6px;
}

.card-brand strong {
    display: block;
    font-size: 25px;
    font-weight: 800;
    color: var(--teal-500);
    letter-spacing: .01em;
    line-height: 1.2;
}

.card-brand span {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--teal-900);
    letter-spacing: .06em;
    margin-top: 2px;
}

.card-rule {
    height: 1px;
    background: var(--line);
    margin: 20px 0 22px;
}

.card-title {
    margin: 0 0 6px;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
}

.card-sub {
    margin: 0 0 26px;
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
}

/* ---- Error banner ---- */
.f-error {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    background: var(--danger-bg);
    border: 1px solid #f3c6c0;
    color: #b03a2e;
    padding: 11px 13px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    animation: shake .45s var(--ease);
}

@keyframes shake {
    0%,100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(5px);
    }

    60% {
        transform: translateX(-3px);
    }

    80% {
        transform: translateX(2px);
    }
}

/* ---- Fields ---- */
.f-field {
    margin-bottom: 16px;
}

    .f-field .wrap {
        position: relative;
    }

    .f-field .ico {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        width: 17px;
        height: 17px;
        color: var(--muted);
        pointer-events: none;
        transition: color .2s;
    }

    .f-field input[type=text],
    .f-field input[type=password] {
        width: 100%;
        background: #fff;
        border: 1px solid var(--line);
        color: var(--ink);
        font-family: var(--font-body);
        font-size: 14.5px;
        padding: 14px 16px 14px 46px;
        border-radius: 12px;
        outline: none;
        transition: border-color .2s, box-shadow .25s;
    }

    .f-field input::placeholder {
        color: var(--muted);
    }

    .f-field input:focus {
        border-color: var(--teal-400);
        box-shadow: 0 0 0 4px var(--teal-100);
    }

        .f-field input:focus + .ico,
        .f-field .wrap:focus-within .ico {
            color: var(--teal-600);
        }

.toggle-pass {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 4px;
    display: flex;
    transition: color .2s;
}

    .toggle-pass:hover {
        color: var(--teal-600);
    }

    .toggle-pass svg {
        width: 17px;
        height: 17px;
    }

.f-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 22px;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 8px;
}

.f-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    cursor: pointer;
}

    .f-remember input {
        accent-color: var(--teal-500);
        width: 15px;
        height: 15px;
    }

.f-forgot {
    color: var(--teal-600);
    text-decoration: none;
    font-weight: 600;
}

    .f-forgot:hover {
        text-decoration: underline;
    }

/* ---- Login button ---- */
.btn-signin {
    position: relative;
    width: 100%;
    border: none;
    cursor: pointer;
    background: var(--teal-500);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 15px;
    padding: 15px 16px;
    border-radius: 12px;
    overflow: hidden;
    isolation: isolate;
    display: block;
    text-align: center;
    box-shadow: 0 10px 22px rgba(13,76,190,.28);
    transition: transform .15s var(--ease-spring), box-shadow .2s, filter .2s, background .2s;
}

    .btn-signin:hover {
        background: var(--teal-600);
        transform: translateY(-1px);
        box-shadow: 0 14px 28px rgba(13,76,190,.34);
    }

    .btn-signin:active {
        transform: translateY(0);
    }

    .btn-signin .ripple {
        position: absolute;
        border-radius: 50%;
        transform: scale(0);
        background: rgba(255,255,255,.5);
        animation: ripple-anim .6s ease-out forwards;
        pointer-events: none;
    }

@keyframes ripple-anim {
    to {
        transform: scale(3.2);
        opacity: 0;
    }
}

.btn-signin.is-loading {
    pointer-events: none;
    color: transparent;
}

.btn-signin .btn-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
}

.btn-signin.is-loading .btn-spinner {
    opacity: 1;
}

.btn-spinner span {
    width: 7px;
    height: 7px;
    margin: 0 3px;
    border-radius: 50%;
    background: #fff;
    display: inline-block;
    animation: dot-bounce 1s ease-in-out infinite;
}

    .btn-spinner span:nth-child(2) {
        animation-delay: .15s;
    }

    .btn-spinner span:nth-child(3) {
        animation-delay: .3s;
    }

@keyframes dot-bounce {
    0%,80%,100% {
        transform: translateY(0);
        opacity: .6;
    }

    40% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* ---- OR divider ---- */
.or-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}

    .or-divider::before,
    .or-divider::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--line);
    }

/* ---- SSO button ---- */
.btn-sso {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: #fff;
    border: 1px solid var(--teal-200);
    color: var(--teal-600);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14.5px;
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .15s;
}

    .btn-sso svg {
        width: 17px;
        height: 17px;
    }

    .btn-sso:hover {
        background: var(--teal-50);
        border-color: var(--teal-300);
        transform: translateY(-1px);
    }

.filled-flash {
    box-shadow: 0 0 0 4px var(--teal-100) !important;
}

/* ================= Responsive ================= */

/* Laptop */
@media (max-width: 1199px) {
    .hero-features {
        gap: 18px;
    }

    .login-card-wrap {
        width: min(460px, 100%);
        padding: 32px 40px 32px 20px;
    }

    .login-card {
        padding: 34px 32px 30px;
    }
}

/* Tablet: stack hero above the card, page scrolls */
@media (max-width: 991px) {
    .login-page {
        flex-direction: column;
        min-height: auto;
    }

    .login-hero {
        padding: 40px clamp(24px, 6vw, 64px) 24px;
        justify-content: center;
    }

    .hero-inner {
        max-width: 640px;
        margin: 0 auto;
        text-align: center;
    }

    .hero-brand {
        justify-content: center;
    }

    .hero-sub {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-rule {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-features {
        grid-template-columns: repeat(4, minmax(0,1fr));
        max-width: 560px;
        margin: 0 auto;
    }

    .hf-item {
        align-items: center;
        text-align: center;
    }

    .login-card-wrap {
        width: 100%;
        padding: 8px 24px 48px;
        justify-content: center;
    }

    .login-card {
        max-height: none;
    }
}

/* Tablet portrait / large phones */
@media (max-width: 767px) {
    .hero-title {
        font-size: 30px;
    }

    .hero-sub {
        font-size: 14.5px;
    }

    .hero-features {
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 22px 16px;
        max-width: 340px;
    }

    .dot-pattern {
        width: 220px;
        height: 220px;
    }
}

/* Mobile */
@media (max-width: 575px) {
    .hero-bg-photo {
        opacity: .5;
    }

    .login-hero {
        padding: 32px 20px 16px;
    }

    .hero-brand-icon {
        height: 42px;
    }

    .hero-brand-text strong {
        font-size: 18px;
    }

    .hero-brand-text span {
        font-size: 10px;
    }

    .hero-title {
        font-size: 26px;
    }

        .hero-title br {
            display: none;
        }

    .hero-sub {
        font-size: 14px;
        margin-bottom: 28px;
    }

    .login-card-wrap {
        padding: 4px 16px 36px;
    }

    .login-card {
        padding: 30px 22px 26px;
        border-radius: 20px;
    }

    .card-brand-icon {
        height: 54px;
    }

    .card-brand strong {
        font-size: 21px;
    }

    .card-title {
        font-size: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-page, .login-card {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
