@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;500;600;700&family=Source+Sans+3:wght@400;500;600;700;800&display=swap');

:root {
    --auth-blue: #5ba4ef;
    --auth-blue-deep: #3f8fe6;
    --auth-clinical: #0b6bcb;
    --auth-teal: #1aa6a0;
    --auth-ink: #3a4555;
    --auth-muted: #9aa3b2;
    --auth-line: #e6ebf2;
    --auth-bg: #d9e6f4;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body.auth-body {
    margin: 0;
    min-height: 100%;
}

body.auth-body {
    font-family: "Source Sans 3", "Noto Sans Bengali", sans-serif;
    color: var(--auth-ink);
    background:
        radial-gradient(1200px 700px at 12% -10%, rgba(26, 166, 160, 0.18), transparent 55%),
        radial-gradient(900px 600px at 95% 110%, rgba(11, 107, 203, 0.22), transparent 50%),
        linear-gradient(155deg, #e8f1fa 0%, #d5e5f5 42%, #c8dcf0 100%);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.auth-page {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
    isolation: isolate;
}

/* Living clinical backdrop behind the auth card */
.auth-atmosphere {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-atmosphere-wash {
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(ellipse 50% 40% at 70% 20%, rgba(91, 164, 239, 0.22), transparent 70%),
        radial-gradient(ellipse 45% 35% at 15% 75%, rgba(26, 166, 160, 0.16), transparent 65%);
    animation: authWash 14s ease-in-out infinite alternate;
}

.auth-atmosphere-grid {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(11, 107, 203, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(11, 107, 203, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 20%, transparent 75%);
}

.auth-atmosphere-beam {
    position: absolute;
    width: 42%;
    height: 140%;
    top: -20%;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: rotate(18deg);
    filter: blur(2px);
    opacity: 0.45;
    animation: authBeam 11s ease-in-out infinite;
}

.auth-atmosphere-beam--a { left: -8%; animation-delay: 0s; }
.auth-atmosphere-beam--b { left: 58%; opacity: 0.28; animation-delay: -5s; animation-duration: 15s; }

.auth-atmosphere-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
    animation: authFloat 10s ease-in-out infinite;
}

.auth-atmosphere-orb--1 {
    width: 180px;
    height: 180px;
    top: 8%;
    left: 6%;
    background: radial-gradient(circle, rgba(91, 164, 239, 0.35), transparent 68%);
}

.auth-atmosphere-orb--2 {
    width: 140px;
    height: 140px;
    bottom: 12%;
    right: 8%;
    background: radial-gradient(circle, rgba(26, 166, 160, 0.28), transparent 68%);
    animation-delay: -4s;
}

.auth-atmosphere-orb--3 {
    width: 90px;
    height: 90px;
    top: 42%;
    right: 22%;
    background: radial-gradient(circle, rgba(11, 107, 203, 0.2), transparent 70%);
    animation-delay: -7s;
    animation-duration: 13s;
}

.auth-atmosphere-ecg {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18%;
    height: 64px;
    opacity: 0.18;
}

.auth-atmosphere-ecg path {
    fill: none;
    stroke: var(--auth-clinical);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: authAtmosphereEcg 7s ease-in-out infinite;
}

.auth-frame {
    position: relative;
    z-index: 1;
    width: min(100%, 960px);
    display: grid;
    grid-template-columns: 1.22fr 1fr;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow:
        0 4px 16px rgba(11, 107, 203, 0.06),
        0 22px 56px rgba(30, 60, 100, 0.16);
    animation: authIn 0.55s cubic-bezier(.2,.8,.2,1) both;
    min-height: min(600px, calc(100vh - 2.5rem));
}

.auth-side-logo--mobile {
    display: none;
}

@media (max-width: 900px) {
    body.auth-body {
        background: #fff;
    }

    .auth-atmosphere {
        display: none;
    }

    .auth-page {
        min-height: 100vh;
        min-height: 100dvh;
        display: block;
        padding: 0;
    }

    .auth-frame {
        grid-template-columns: 1fr;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        border-radius: 0;
        box-shadow: none;
        animation: none;
    }

    .auth-visual {
        display: none !important;
    }

    .auth-side {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 1.25rem 1.25rem 1.5rem;
        justify-content: flex-start;
    }

    .auth-side-brand {
        margin-bottom: 1.25rem;
        padding: 0;
    }

    .auth-side-logo {
        width: clamp(140px, 42vw, 200px);
        max-height: 200px;
    }

    .auth-side-main {
        flex: 0 0 auto;
        justify-content: flex-start;
        max-width: 100%;
        margin: 0;
        padding: 0;
        text-align: left;
    }

    .auth-title {
        font-size: 1.65rem;
    }

    .auth-subtitle {
        margin-bottom: 1.15rem;
    }
}

@media (max-width: 520px) {
    .auth-side {
        padding: 1rem 1.1rem 1.25rem;
    }

    .auth-side-logo {
        width: clamp(130px, 48vw, 180px);
        max-height: 180px;
    }
}

/* Left visual */
.auth-visual {
    position: relative;
    min-height: 100%;
    height: 100%;
    color: #fff;
    padding: 1.25rem 1.35rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    isolation: isolate;
}

.auth-visual-media {
    position: absolute;
    inset: 0;
    background-image: var(--auth-bg-image);
    background-position: 58% 42%;
    background-size: cover;
    background-repeat: no-repeat;
    transform: scale(1.08);
    filter: saturate(1.05) contrast(1.04);
    animation: authKenBurns 18s ease-in-out infinite alternate;
    z-index: 0;
}

.auth-visual-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(165deg,
            rgba(8, 28, 52, 0.72) 0%,
            rgba(10, 48, 78, 0.42) 38%,
            rgba(8, 70, 92, 0.55) 72%,
            rgba(6, 36, 62, 0.78) 100%),
        radial-gradient(520px 280px at 78% 28%, rgba(26, 166, 160, 0.28), transparent 62%),
        radial-gradient(480px 260px at 18% 82%, rgba(91, 164, 239, 0.3), transparent 60%);
}

.auth-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 28%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.28), transparent 36%);
    z-index: 1;
    pointer-events: none;
}

.auth-visual-glow {
    position: absolute;
    width: 260px;
    height: 260px;
    right: -50px;
    bottom: 16%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(26, 166, 160, 0.38), rgba(91, 164, 239, 0.12) 45%, transparent 70%);
    filter: blur(10px);
    z-index: 1;
    animation: authGlow 6s ease-in-out infinite;
    pointer-events: none;
}

.auth-pulse-ring {
    position: absolute;
    right: 14%;
    top: 28%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 1.5px solid rgba(157, 220, 214, 0.45);
    z-index: 1;
    pointer-events: none;
    animation: authPulseRing 3.2s ease-out infinite;
}

.auth-pulse-ring--2 {
    width: 120px;
    height: 120px;
    animation-delay: 1.1s;
    border-color: rgba(158, 201, 255, 0.4);
}

.auth-cross {
    position: absolute;
    top: 46%;
    left: 50%;
    width: 56px;
    height: 56px;
    transform: translate(-50%, -50%);
    z-index: 1;
    opacity: 0.14;
    pointer-events: none;
}

.auth-cross::before,
.auth-cross::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    background: #fff;
    border-radius: 3px;
    transform: translate(-50%, -50%);
}

.auth-cross::before {
    width: 18px;
    height: 56px;
}

.auth-cross::after {
    width: 56px;
    height: 18px;
}

.auth-visual-orb {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    z-index: 1;
    pointer-events: none;
    animation: authOrb 9s ease-in-out infinite;
}

.auth-visual-orb--1 {
    width: 120px;
    height: 120px;
    top: 18%;
    right: 10%;
    background: rgba(255, 255, 255, 0.04);
}

.auth-visual-orb--2 {
    width: 70px;
    height: 70px;
    bottom: 28%;
    left: 12%;
    background: rgba(26, 166, 160, 0.12);
    animation-delay: -3s;
}

.auth-ecg {
    position: absolute;
    left: 6%;
    right: 6%;
    bottom: 22%;
    height: 56px;
    z-index: 1;
    opacity: 0.7;
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(125, 211, 252, 0.35));
}

.auth-ecg path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-ecg-trail {
    stroke: rgba(158, 201, 255, 0.28);
    stroke-width: 2;
}

.auth-ecg-live {
    stroke: #7dd3fc;
    stroke-width: 2.2;
    stroke-dasharray: 640;
    stroke-dashoffset: 640;
    animation: authEcg 4.8s ease-in-out infinite;
}

.auth-visual-top,
.auth-visual-bottom {
    position: relative;
    z-index: 2;
}

.auth-visual-top {
    flex: 0 0 auto;
}

.auth-visual-bottom {
    flex: 0 0 auto;
    margin-top: auto;
    max-width: 26rem;
    padding-top: 1rem;
}

.auth-visual-brand {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 100%;
    margin: 0;
    animation: authRise 0.7s ease both;
}

.auth-visual-brand strong {
    display: block;
    font-size: clamp(1.25rem, 2.4vw, 1.65rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #fff;
    word-break: break-word;
}

.auth-visual-brand em {
    display: block;
    font-style: normal;
    font-size: clamp(0.72rem, 1.3vw, 0.82rem);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(186, 214, 255, 0.9);
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #cfe3ff;
    margin-bottom: 0.65rem;
    animation: authRise 0.75s ease 0.08s both;
}

.auth-kicker i {
    color: #8ec2ff;
}

.auth-visual-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.25rem, 2.4vw, 1.7rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.18;
}

.auth-line {
    display: block;
    animation: authRise 0.8s ease both;
}

.auth-line:nth-child(1) { animation-delay: 0.12s; }

.auth-line--accent {
    background: linear-gradient(100deg, #fff 8%, #9ec9ff 48%, #5eead4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation-delay: 0.22s;
}

.auth-visual-sub {
    margin: 0;
    font-size: clamp(0.8rem, 1.3vw, 0.9rem);
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.78);
    max-width: 22rem;
    animation: authRise 0.85s ease 0.28s both;
}

.auth-visual-foot {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.9rem;
    animation: authRise 0.7s ease 0.55s both;
}

/* Right form */
.auth-side {
    position: relative;
    padding: 1.15rem 1.35rem 1.15rem;
    display: flex;
    flex-direction: column;
}

.auth-side-brand {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    margin: 0 0 0.35rem;
    padding: 0.15rem 0 0.25rem;
}

.auth-side-logo {
    width: clamp(110px, 22vw, 168px);
    height: auto;
    max-height: 168px;
    object-fit: contain;
    display: block;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.auth-side-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    padding: 0.5rem 0 0.75rem;
}

.auth-title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #364152;
}

.auth-subtitle {
    margin: 0.2rem 0 0.95rem;
    font-size: 0.86rem;
    color: var(--auth-muted);
}

.auth-alert {
    text-align: left;
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    font-size: 0.84rem;
    margin-bottom: 0.95rem;
}

.auth-alert--danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.auth-alert--lockdown {
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
}

.auth-alert__row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    width: 100%;
}

.auth-alert__icon {
    font-size: 1.2rem;
    line-height: 1.25;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.auth-alert__body {
    flex: 1;
    min-width: 0;
}

.auth-alert__title {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.15rem;
}

.auth-alert__text {
    display: block;
    font-size: 0.82rem;
    line-height: 1.4;
    opacity: 0.95;
}

.auth-alert--success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.auth-alert ul {
    margin: 0;
    padding-left: 1rem;
}

.auth-field {
    margin-bottom: 0.7rem;
    text-align: left;
}

.auth-control {
    position: relative;
}

.auth-control > .bi.auth-ico {
    position: absolute;
    left: 1.05rem;
    top: 50%;
    transform: translateY(-50%);
    color: #b0b8c6;
    font-size: 1.05rem;
    pointer-events: none;
}

.auth-input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--auth-line);
    border-radius: 999px;
    background: #fff;
    padding: 0 2.75rem 0 2.85rem;
    font-size: 0.9rem;
    color: var(--auth-ink);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.auth-input::placeholder {
    color: #b6becb;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 4px rgba(91, 164, 239, 0.16);
}

.auth-control:focus-within > .bi.auth-ico {
    color: var(--auth-blue);
}

.auth-input.is-invalid {
    border-color: #f87171;
}

.auth-eye {
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #b0b8c6;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.auth-eye:hover {
    color: var(--auth-blue);
    background: #f3f8ff;
}

.auth-error {
    display: block;
    margin-top: 0.3rem;
    padding-left: 0.85rem;
    font-size: 0.78rem;
    color: #b91c1c;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0.05rem 0 0.85rem;
    text-align: left;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.86rem;
    color: #7b8798;
    cursor: pointer;
    user-select: none;
}

.auth-check input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--auth-blue);
}

.auth-link {
    color: var(--auth-blue);
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
    color: var(--auth-blue-deep);
}

.auth-btn {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: var(--auth-blue);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 22px rgba(91, 164, 239, 0.35);
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease, opacity .2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.auth-btn:hover {
    background: var(--auth-blue-deep);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(91, 164, 239, 0.4);
}

.auth-btn:disabled,
.auth-btn.is-loading {
    opacity: 0.85;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 8px 18px rgba(91, 164, 239, 0.25);
}

.auth-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.7s linear infinite;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

.auth-alt {
    margin-top: 1rem;
    font-size: 0.86rem;
    color: #8b95a5;
}

.auth-side-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
    padding-top: 0.5rem;
    font-size: 0.78rem;
    color: #a0a8b6;
}

.auth-side-foot a {
    color: #a0a8b6;
    text-decoration: none;
}

.auth-side-foot a:hover {
    color: var(--auth-blue);
}

.auth-side-foot .sep {
    color: #cfd5df;
}

@keyframes authIn {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes authRise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes authPulse {
    0% { transform: scale(0.92); opacity: 0.75; }
    100% { transform: scale(1.28); opacity: 0; }
}

@keyframes authPulseRing {
    0% { transform: scale(0.55); opacity: 0.7; }
    100% { transform: scale(1.85); opacity: 0; }
}

@keyframes authKenBurns {
    from { transform: scale(1.08) translate(0, 0); }
    to { transform: scale(1.16) translate(-1.5%, 1%); }
}

@keyframes authGlow {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.12); }
}

@keyframes authOrb {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes authEcg {
    0% { stroke-dashoffset: 640; opacity: 0.25; }
    35% { opacity: 0.95; }
    100% { stroke-dashoffset: 0; opacity: 0.3; }
}

@keyframes authAtmosphereEcg {
    0% { stroke-dashoffset: 1200; opacity: 0.1; }
    40% { opacity: 0.45; }
    100% { stroke-dashoffset: 0; opacity: 0.12; }
}

@keyframes authWash {
    from { transform: translate3d(-1.5%, 0, 0) scale(1); }
    to { transform: translate3d(2%, 1.5%, 0) scale(1.04); }
}

@keyframes authBeam {
    0%, 100% { opacity: 0.2; transform: translateX(0) rotate(18deg); }
    50% { opacity: 0.55; transform: translateX(8%) rotate(18deg); }
}

@keyframes authFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-18px); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-frame,
    .auth-visual-media,
    .auth-visual-glow,
    .auth-visual-orb,
    .auth-pulse-ring,
    .auth-ecg path,
    .auth-atmosphere-wash,
    .auth-atmosphere-beam,
    .auth-atmosphere-orb,
    .auth-atmosphere-ecg path,
    .auth-visual-brand,
    .auth-kicker,
    .auth-line,
    .auth-visual-sub,
    .auth-visual-foot {
        animation: none !important;
    }
    .auth-btn:hover { transform: none; }
}
