@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Inter:wght@500;600;700;800&display=swap');

:root {
    color-scheme: dark;
    --auth-bg: #031225;
    --auth-panel: #061a31;
    --auth-card: rgba(4, 20, 39, .94);
    --auth-line: rgba(54, 190, 239, .72);
    --auth-text: #f7fbff;
    --auth-muted: #aebfd2;
    --auth-input: #122944;
    --auth-input-line: #34506c;
    --auth-blue: #2468ff;
    --auth-cyan: #08c4eb;
    --auth-green: #03dfad;
    --auth-danger: #ff9bac;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; }
body {
    margin: 0;
    min-width: 320px;
    min-height: 100%;
    background: var(--auth-bg);
    color: var(--auth-text);
    font-family: 'Hind Siliguri', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }

.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(520px, 58%) minmax(430px, 42%);
    background:
        radial-gradient(circle at 55% 10%, rgba(0, 169, 236, .14), transparent 34rem),
        linear-gradient(110deg, #04192e 0%, #05182d 58%, #021124 100%);
}

.auth-visual {
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    overflow: hidden;
    background-color: #03182b;
    background-image: url('pharmacy-scene.webp');
    background-repeat: no-repeat;
    background-size: auto 100%;
    background-position: left center;
}
.auth-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent 74%, rgba(3, 18, 37, .35) 88%, #031225 100%),
        linear-gradient(0deg, rgba(3, 18, 37, .18), transparent 22%);
}

.auth-side {
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px clamp(20px, 3vw, 54px);
    background:
        radial-gradient(circle at 45% 7%, rgba(1, 172, 230, .12), transparent 26rem),
        var(--auth-panel);
    overflow: hidden;
    isolation: isolate;
}
.auth-side::before {
    content: '';
    position: absolute;
    inset: -24px;
    z-index: -1;
    pointer-events: none;
    background: url('pharmacy-scene.webp') center / cover no-repeat;
    opacity: .075;
    filter: blur(10px) saturate(.75);
}

.auth-card {
    width: min(100%, 650px);
    position: relative;
    padding: clamp(26px, 3vw, 46px);
    border: 1px solid var(--auth-line);
    border-radius: 32px;
    background: var(--auth-card);
    box-shadow:
        0 28px 80px rgba(0, 0, 0, .3),
        0 0 36px rgba(0, 174, 239, .08),
        inset 0 1px 0 rgba(255, 255, 255, .035);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: authEnter .55s ease both;
}
.register-page .auth-card { width: min(100%, 700px); padding-block: clamp(22px, 2vw, 34px); }

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}
.brand-mark {
    width: 62px;
    height: 62px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: #06344a;
    background: linear-gradient(145deg, var(--auth-green), var(--auth-cyan));
    box-shadow: 0 10px 28px rgba(0, 220, 189, .16);
    font: 800 42px/1 Inter, sans-serif;
}
.brand-name {
    font: 800 clamp(31px, 3.1vw, 47px)/1 Inter, sans-serif;
    letter-spacing: -1.6px;
}
.brand-subtitle {
    margin-top: 8px;
    color: var(--auth-muted);
    font: 500 clamp(11px, 1vw, 14px)/1.35 Inter, sans-serif;
}

.auth-card h1 {
    margin: 0;
    text-align: center;
    color: var(--auth-text);
    font-size: clamp(29px, 3vw, 43px);
    line-height: 1.28;
}
.auth-lead {
    margin: 7px 0 30px;
    text-align: center;
    color: var(--auth-muted);
    font-size: clamp(15px, 1.2vw, 18px);
}
.register-page .auth-brand { margin-bottom: 15px; }
.register-page .auth-card h1 { font-size: clamp(27px, 2.5vw, 38px); }
.register-page .auth-lead { margin-bottom: 18px; }

.auth-error {
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid rgba(255, 111, 135, .48);
    border-radius: 13px;
    color: var(--auth-danger);
    background: rgba(203, 41, 69, .13);
    font-weight: 600;
}

.auth-field { min-width: 0; margin-bottom: 17px; }
.register-page .auth-field { margin-bottom: 11px; }
.auth-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--auth-muted);
    font-size: 15px;
    font-weight: 700;
}
.input-shell { position: relative; }
.auth-field input,
.auth-field textarea {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 58px;
    padding: 14px 48px 14px 17px;
    border: 1px solid var(--auth-input-line);
    border-radius: 16px;
    outline: none;
    color: var(--auth-text);
    background: var(--auth-input);
    font-size: 17px;
    font-weight: 600;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.auth-field textarea {
    min-height: 78px;
    padding-right: 17px;
    resize: vertical;
}
.register-page .auth-field input { min-height: 51px; padding-block: 11px; }
.register-page .auth-field textarea { min-height: 66px; }
.auth-field input::placeholder,
.auth-field textarea::placeholder { color: #7f92a7; opacity: .85; }
.auth-field input:focus,
.auth-field textarea:focus {
    border-color: #19bdff;
    background: #102b49;
    box-shadow: 0 0 0 4px rgba(25, 189, 255, .14), 0 0 22px rgba(25, 189, 255, .08);
}
.password-toggle {
    position: absolute;
    top: 50%;
    right: 11px;
    width: 38px;
    height: 38px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 10px;
    color: #b6c9dd;
    background: transparent;
    cursor: pointer;
    font-size: 19px;
}
.password-toggle:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.auth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.auth-tools { display: flex; justify-content: flex-end; margin: -2px 0 13px; }
.auth-tools a,
.auth-bottom a { color: #0ec9f4; text-decoration: none; font-weight: 700; }
.auth-tools a:hover,
.auth-bottom a:hover { text-decoration: underline; }

.auth-submit {
    width: 100%;
    min-height: 61px;
    margin-top: 7px;
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(100deg, #3159ff 0%, #03aef0 56%, #00dfad 100%);
    box-shadow: 0 13px 34px rgba(0, 144, 238, .3);
    font-size: clamp(18px, 1.45vw, 22px);
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}
.auth-submit::after {
    content: '';
    position: absolute;
    top: -95%;
    left: -30%;
    width: 18%;
    height: 290%;
    transform: rotate(24deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
    animation: authShine 4.5s infinite;
}
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 17px 42px rgba(0, 178, 235, .4); }
.auth-submit:focus-visible { outline: 3px solid rgba(26, 208, 255, .55); outline-offset: 3px; }
.register-page .auth-submit { min-height: 55px; }

.auth-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    color: var(--auth-muted);
}
.auth-divider::before,
.auth-divider::after { content: ''; height: 1px; background: rgba(151, 177, 204, .28); }
.auth-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
    padding: 10px 18px;
    border: 2px solid var(--auth-green);
    border-radius: 999px;
    color: var(--auth-green);
    text-decoration: none;
    font-size: 18px;
    font-weight: 800;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}
.auth-secondary:hover { color: #03291f; background: var(--auth-green); transform: translateY(-1px); }
.auth-bottom,
.auth-copyright { text-align: center; color: var(--auth-muted); }
.auth-bottom { margin: 18px 0 0; font-size: 16px; }
.auth-copyright { margin: 18px 0 0; font: 500 13px Inter, sans-serif; }
.register-page .auth-bottom { margin-top: 12px; }
.register-page .auth-copyright { margin-top: 10px; }

@keyframes authEnter { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: none; } }
@keyframes authShine { 0%, 67% { left: -30%; } 92%, 100% { left: 125%; } }

@media (max-width: 1280px) and (min-width: 901px) {
    .auth-shell { grid-template-columns: minmax(440px, 51%) minmax(430px, 49%); }
    .auth-side { padding: 24px 18px; }
    .auth-card { padding: 26px; border-radius: 25px; }
    .register-page .auth-card { padding: 21px 24px; }
    .auth-brand { margin-bottom: 16px; }
    .brand-mark { width: 54px; height: 54px; font-size: 36px; }
    .auth-lead { margin-bottom: 20px; }
    .auth-field { margin-bottom: 13px; }
    .register-page .auth-field { margin-bottom: 8px; }
}

@media (max-width: 900px) {
    .auth-shell {
        position: relative;
        isolation: isolate;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100dvh;
        padding: 20px 0;
        background: #031225;
    }
    .auth-shell::before {
        content: '';
        position: fixed;
        inset: 0;
        z-index: -2;
        background-image: url('pharmacy-scene.webp');
        background-repeat: no-repeat;
        background-size: cover;
        background-position: 42% center;
        filter: saturate(.88);
    }
    .auth-shell::after {
        content: '';
        position: fixed;
        inset: 0;
        z-index: -1;
        background:
            radial-gradient(circle at 50% 20%, rgba(0, 194, 232, .12), transparent 23rem),
            linear-gradient(180deg, rgba(2, 14, 29, .62), rgba(2, 14, 29, .88));
    }
    .auth-visual { display: none; }
    .auth-side {
        min-height: 0;
        width: 100%;
        padding: 16px 18px;
        align-items: center;
        background: transparent;
        overflow: visible;
    }
    .auth-side::before { display: none; }
    .auth-card {
        width: min(100%, 690px);
        background: rgba(3, 19, 38, .72);
        border-color: rgba(64, 204, 249, .72);
        box-shadow: 0 26px 75px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255, 255, 255, .06);
        backdrop-filter: blur(24px) saturate(1.15);
        -webkit-backdrop-filter: blur(24px) saturate(1.15);
    }
}

@media (max-width: 600px) {
    .auth-shell { padding: 10px 0; }
    .auth-shell::before { background-position: 45% center; }
    .auth-side { padding: 10px; }
    .auth-card,
    .register-page .auth-card {
        padding: 22px 17px;
        border-radius: 24px;
        background: rgba(3, 19, 38, .69);
    }
    .auth-brand { gap: 11px; margin-bottom: 18px; }
    .brand-mark { width: 50px; height: 50px; border-radius: 14px; font-size: 34px; }
    .brand-name { font-size: 29px; letter-spacing: -1px; }
    .brand-subtitle { margin-top: 4px; font-size: 9.5px; }
    .auth-card h1 { font-size: 28px; }
    .register-page .auth-card h1 { font-size: 26px; }
    .auth-lead { margin-bottom: 22px; font-size: 15px; }
    .auth-grid { grid-template-columns: 1fr; gap: 0; }
    .auth-field input,
    .auth-field textarea { font-size: 16px; }
    .auth-submit { min-height: 56px; }
    .auth-secondary { font-size: 16px; }
}

@media (max-width: 390px) {
    .auth-side { padding-left: 8px; padding-right: 8px; }
    .auth-card,
    .register-page .auth-card { padding: 20px 13px; }
    .brand-name { font-size: 26px; }
    .auth-field input { padding-left: 13px; }
}

@media (max-height: 760px) and (min-width: 901px) {
    .auth-side { align-items: flex-start; overflow-y: auto; padding-top: 22px; }
    .login-page .auth-card { padding-block: 25px; }
    .register-page .auth-card { padding-block: 18px; }
    .register-page .auth-brand { margin-bottom: 9px; }
    .register-page .auth-lead { margin-bottom: 10px; }
    .register-page .auth-field { margin-bottom: 6px; }
    .register-page .auth-field input { min-height: 46px; }
    .register-page .auth-field textarea { min-height: 58px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
