﻿:root { --hms-safe-top: env(safe-area-inset-top, 0px); --hms-safe-bottom: env(safe-area-inset-bottom, 0px); }

/* â€”â€” Admin login (split layout) â€”â€” */
.hms-admin-app--login {
    background: #f8fafc;
}

.hms-login {
    min-height: 100dvh;
    min-height: 100svh;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    overflow-x: hidden;
}

@media (min-width: 960px) {
    .hms-login {
        grid-template-columns: minmax(380px, 1.05fr) minmax(400px, 1fr);
    }
}

/* Hero panel */
.hms-login__hero {
    position: relative;
    background: linear-gradient(145deg, #0a1628 0%, #132f52 40%, #0c4a6e 100%);
    color: #fff;
    overflow: hidden;
    padding: calc(1.25rem + var(--hms-safe-top)) 1.5rem 2rem;
}

.hms-login__hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(56, 189, 248, 0.25) 0%, transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.2) 0%, transparent 40%),
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: auto, auto, 32px 32px, 32px 32px;
}

.hms-login__hero-inner {
    position: relative;
    z-index: 1;
    max-width: 440px;
    margin: 0 auto;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

@media (min-width: 960px) {
    .hms-login__hero-inner {
        margin: 0;
        margin-left: auto;
        margin-right: 2rem;
        justify-content: center;
        padding: 2rem 0;
    }

    .hms-login__mobile-trust {
        display: none !important;
    }
}

.hms-login__back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.hms-login__back:hover {
    color: #fff;
}

.hms-login__back svg {
    width: 1rem;
    height: 1rem;
}

.hms-login__brand {
    margin-bottom: 2.5rem;
}

.hms-login__logo {
    width: 4rem;
    height: 4rem;
    border-radius: 1.15rem;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 40px rgba(14, 116, 144, 0.45);
    margin-bottom: 1.25rem;
    flex-shrink: 0;
    overflow: hidden;
}

.hms-login__logo--image {
    width: 5rem;
    height: 5rem;
    padding: 0.4rem;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
}

.hms-login__logo img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.hms-login__logo svg {
    width: 2rem;
    height: 2rem;
    color: #fff;
}

.hms-login__brand-title {
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 0;
}

.hms-login__brand-tag {
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}

.hms-login__features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.hms-login__features li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.85rem;
    backdrop-filter: blur(8px);
}

.hms-login__features strong {
    display: block;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

.hms-login__feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border-radius: 0.6rem;
    background: rgba(56, 189, 248, 0.2);
    color: #7dd3fc;
}

.hms-login__feature-icon svg {
    width: 1.15rem;
    height: 1.15rem;
}

/* Form panel */
.hms-login__main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(1.5rem + var(--hms-safe-top)) 1.25rem calc(1.25rem + var(--hms-safe-bottom));
    background: #f8fafc;
}

@media (min-width: 960px) {
    .hms-login__main {
        padding: 2.5rem 3rem;
        background: #fff;
        box-shadow: -12px 0 48px rgba(15, 23, 42, 0.06);
    }
}

.hms-login__form-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 1.5rem;
    padding: 2rem 1.75rem;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 12px 40px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
}

@media (min-width: 960px) {
    .hms-login__form-card {
        box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
        border: 1px solid #f1f5f9;
        padding: 2.25rem 2rem;
    }
}

.hms-login__form-head {
    margin-bottom: 1.75rem;
}

.hms-login__badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #0369a1;
    background: #e0f2fe;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    margin-bottom: 0.85rem;
}

.hms-login__form-head h2 {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.hms-login__form-head p {
    margin: 0.4rem 0 0;
    font-size: 0.9rem;
    color: #64748b;
}

.hms-login__alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.75rem;
    color: #b91c1c;
    font-size: 0.875rem;
    font-weight: 500;
}

.hms-login__alert--success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.hms-login__alert svg {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.hms-login__form {
    display: flex;
    flex-direction: column;
}

.hms-login__form-actions .hms-login__options {
    margin: 0.25rem 0 1rem;
}

.hms-login__field {
    margin-bottom: 1.15rem;
}

.hms-login__field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.45rem;
}

.hms-login__input {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 0 0.9rem;
    min-height: 3.125rem;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.hms-login__input:focus-within {
    background: #fff;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.hms-login__input.is-invalid {
    border-color: #f87171;
    background: #fffafb;
}

.hms-login__input.is-invalid:focus-within {
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.15);
}

.hms-login__input > svg:first-of-type {
    width: 1.2rem;
    height: 1.2rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.hms-login__input input {
    flex: 1;
    border: 0;
    background: transparent;
    font-size: 1rem;
    padding: 0.75rem 0;
    outline: none;
    min-width: 0;
    color: #0f172a;
}

.hms-login__input input::placeholder {
    color: #94a3b8;
}

.hms-login__toggle-pw {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.hms-login__toggle-pw:hover {
    color: #2563eb;
    background: #eff6ff;
}

.hms-login__toggle-pw svg {
    width: 1.15rem;
    height: 1.15rem;
}

.hms-login__error {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: #dc2626;
    font-weight: 500;
}

.hms-login__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.25rem 0 1.35rem;
    font-size: 0.875rem;
}

.hms-login__remember {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    color: #475569;
    font-weight: 500;
}

.hms-login__remember input {
    width: 1rem;
    height: 1rem;
    accent-color: #2563eb;
}

.hms-login__forgot {
    color: #2563eb;
    font-weight: 600;
}

.hms-login__forgot:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.hms-login__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 3.125rem;
    border: 0;
    border-radius: 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #1d4ed8 0%, #0284c7 100%);
    box-shadow: 0 4px 14px rgba(29, 78, 216, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.hms-login__submit:hover {
    box-shadow: 0 8px 24px rgba(29, 78, 216, 0.4);
}

.hms-login__submit:active {
    transform: scale(0.99);
}

.hms-login__submit svg {
    width: 1.15rem;
    height: 1.15rem;
}

.hms-login__footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.hms-login__footer-text {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    color: #94a3b8;
}

.hms-login__link-patient {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    padding: 0.55rem 1rem;
    border-radius: 0.65rem;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    transition: border-color 0.2s, background 0.2s;
}

.hms-login__link-patient:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.hms-login__link-patient svg {
    width: 1rem;
    height: 1rem;
    color: #64748b;
}

.hms-login__copy {
    margin: 1.5rem 0 0;
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Mobile trust chips (hidden on desktop) */
.hms-login__mobile-trust {
    display: none;
}

/* â€”â€” Mobile & tablet responsive â€”â€” */
@media (max-width: 959px) {
    .hms-admin-app--login {
        overflow-x: hidden;
        overflow-y: auto;
        min-height: 100dvh;
        min-height: 100svh;
    }

    .hms-login {
        display: flex;
        flex-direction: column;
        min-height: 100dvh;
        min-height: 100svh;
    }

    .hms-login__hero {
        flex-shrink: 0;
        padding:
            calc(0.5rem + var(--hms-safe-top))
            max(1rem, env(safe-area-inset-right))
            1.75rem
            max(1rem, env(safe-area-inset-left));
    }

    .hms-login__hero-inner {
        min-height: auto;
    }

    .hms-login__back {
        margin-bottom: 0.35rem;
        min-height: 2.25rem;
        font-size: 0.8rem;
    }

    .hms-login__brand {
        margin-bottom: 0.5rem;
        text-align: center;
    }

    .hms-login__logo {
        width: 2.75rem;
        height: 2.75rem;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 0.5rem;
    }

    .hms-login__logo--image {
        width: 3.25rem;
        height: 3.25rem;
        padding: 0.3rem;
    }

    .hms-login__logo svg {
        width: 1.35rem;
        height: 1.35rem;
    }

    .hms-login__brand-title {
        font-size: 1.05rem;
        padding: 0 0.5rem;
        line-height: 1.25;
    }

    .hms-login__brand-tag {
        display: none;
    }

    .hms-login__features {
        display: none;
    }

    .hms-login__mobile-trust {
        display: none;
    }

    .hms-login__main {
        flex: 1;
        display: flex;
        flex-direction: column;
        margin-top: -1.25rem;
        padding: 0;
    }

    .hms-login__form-card {
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 1.25rem 1.25rem 0 0;
        padding: 1.35rem 1rem calc(1rem + var(--hms-safe-bottom));
        box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.1);
        border: 1px solid #e2e8f0;
        border-bottom: 0;
    }

    .hms-login__form-head {
        margin-bottom: 1rem;
        padding-top: 0.25rem;
    }

    .hms-login__badge {
        margin-bottom: 0.6rem;
        font-size: 0.65rem;
    }

    .hms-login__form-head h2 {
        font-size: 1.25rem;
    }

    .hms-login__form-desc {
        display: none;
    }

    .hms-login__alert {
        flex-shrink: 0;
        margin-bottom: 0.75rem;
        padding: 0.65rem 0.85rem;
        font-size: 0.8125rem;
    }

    .hms-login__form {
        display: block;
    }

    .hms-login__form-scroll {
        /* natural height only â€” no flex stretch (removes empty gap) */
    }

    .hms-login__form-actions {
        margin-top: 0.25rem;
        padding-top: 0.85rem;
        border-top: 1px solid #f1f5f9;
    }

    .hms-login__field {
        margin-bottom: 0.75rem;
    }

    .hms-login__field:last-child {
        margin-bottom: 0;
    }

    .hms-login__field label {
        font-size: 0.75rem;
        margin-bottom: 0.35rem;
    }

    .hms-login__input {
        min-height: 2.875rem;
        padding: 0 0.85rem;
    }

    .hms-login__input input {
        font-size: 16px;
        padding: 0.65rem 0;
    }

    .hms-login__toggle-pw {
        width: 2.5rem;
        height: 2.5rem;
        min-width: 2.5rem;
    }

    .hms-login__options {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        margin: 0 0 0.65rem;
    }

    .hms-login__remember {
        min-height: auto;
        font-size: 0.8125rem;
    }

    .hms-login__forgot {
        text-align: right;
        min-height: auto;
        font-size: 0.8125rem;
        margin-left: auto;
    }

    .hms-login__submit {
        min-height: 3rem;
        font-size: 1rem;
        border-radius: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .hms-login__submit span {
        font-size: 0.95rem;
    }

    .hms-login__footer {
        margin-top: 0.5rem;
        padding-top: 0.65rem;
    }

    .hms-login__footer-text {
        display: none;
    }

    .hms-login__link-patient {
        width: 100%;
        justify-content: center;
        min-height: 2.5rem;
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .hms-login__copy {
        display: none;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .hms-login__hero {
        padding-bottom: 1.5rem;
    }

    .hms-login__form-card {
        padding: 1.15rem 0.85rem calc(0.85rem + var(--hms-safe-bottom));
    }

    .hms-login__form-head {
        padding-top: 0.15rem;
    }

    .hms-login__form-head h2 {
        font-size: 1.15rem;
    }
}

/* Tablet portrait */
@media (min-width: 600px) and (max-width: 959px) {
    .hms-login__main {
        align-items: center;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .hms-login__form-card {
        max-width: 440px;
        border-radius: 1.5rem;
        margin-top: 0;
        border: 1px solid #e2e8f0;
        box-shadow: 0 12px 40px rgba(15, 23, 42, 0.1);
    }

    .hms-login__hero {
        padding-bottom: 2rem;
    }

    .hms-login__brand-tag {
        display: block;
        font-size: 0.8rem;
    }

    .hms-login__form-desc {
        display: block;
        font-size: 0.85rem;
    }
}

/* Landscape phones */
@media (max-width: 959px) and (max-height: 500px) and (orientation: landscape) {
    .hms-login {
        grid-template-columns: 1fr 1.1fr;
        grid-template-rows: 1fr;
    }

    .hms-login__hero {
        padding: calc(0.5rem + var(--hms-safe-top)) 1rem 1rem;
    }

    .hms-login__brand {
        margin-bottom: 0.5rem;
    }

    .hms-login__logo {
        width: 2.75rem;
        height: 2.75rem;
        margin-bottom: 0.5rem;
    }

    .hms-login__brand-title {
        font-size: 1rem;
    }

    .hms-login__brand-tag,
    .hms-login__mobile-trust {
        display: none;
    }

    .hms-login__main {
        margin-top: 0;
        justify-content: center;
        overflow-y: auto;
    }

    .hms-login__form-card {
        border-radius: 1rem;
        padding: 1.25rem;
    }

    .hms-login__form-head {
        margin-bottom: 1rem;
    }

    .hms-login__copy {
        display: none;
    }
}
