/* ==========================================================================
   HospitalERP Public Landing Page & Auth Styling
   Clean, Modern, Fully Responsive & Zero Vertical Scroll on Desktop/PC
   ========================================================================== */

:root {
    --bs-body-bg: #f8fafc !important;
    --primary-blue: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-active: #1e40af;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --card-radius: 1rem;
    --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    color-scheme: light;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: radial-gradient(ellipse at 50% 0%, #ffffff 0%, #f8fafc 60%, #f0fdf4 100%);
    color: var(--text-dark);
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   Smooth Entrance Animations (GPU Accelerated)
   ========================================================================== */
@keyframes smoothFadeInUp {
    0% {
        opacity: 0;
        transform: translate3d(0, 14px, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes smoothSlideDown {
    0% {
        opacity: 0;
        transform: translateY(-6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Public Header
   ========================================================================== */
.pub-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    flex-shrink: 0;
}

.pub-header-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pub-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.pub-brand .brand-ic {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
    flex-shrink: 0;
}

.pub-brand .brand-tx {
    font-size: 1.22rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.02em;
    line-height: 1;
}

.pub-brand .brand-tx span {
    color: #2563eb;
}

.brand-divider {
    display: inline-block;
    width: 1px;
    height: 24px;
    background: #cbd5e1;
    margin: 0 0.25rem;
}

.brand-powered {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.15;
    flex-shrink: 0;
}

.powered-top {
    font-size: 0.65rem;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.powered-top span {
    color: #2563eb;
}

.powered-hr {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--border-color);
    margin: 1px 0;
}

.powered-bottom {
    font-size: 0.58rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.pub-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pub-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #475569;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.45rem 0.9rem;
    border-radius: 0.55rem;
    transition: all 0.2s ease;
}

.pub-nav-link:hover {
    color: var(--text-dark);
    background: #f1f5f9;
}

.pub-nav-link.active {
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-weight: 700;
}

.pub-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.btn-pub-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1.1rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff !important;
    font-size: 0.84rem;
    font-weight: 700;
    border-radius: 2rem;
    text-decoration: none;
    transition: all 0.22s ease;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
    border: none;
}

.btn-pub-primary:hover {
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.35);
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.pub-mobile-toggle {
    display: none;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    color: #334155;
    font-size: 1.25rem;
    padding: 0.35rem 0.6rem;
    border-radius: 0.5rem;
    cursor: pointer;
    line-height: 1;
}

.pub-mobile-menu {
    display: none;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 1.25rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.pub-mobile-menu.show {
    display: block;
    animation: smoothSlideDown 0.2s var(--transition-smooth) forwards;
}

.pub-mobile-menu .pub-nav-link {
    display: flex;
    width: 100%;
    margin-bottom: 0.35rem;
    padding: 0.65rem 0.9rem;
    color: #475569;
    font-size: 0.92rem;
    transition: all 0.2s var(--transition-smooth);
}

.pub-mobile-menu .pub-nav-link:hover,
.pub-mobile-menu .pub-nav-link.active {
    color: #2563eb;
    background: #eff6ff;
}

/* ==========================================================================
   Main Auth & Cards Container
   ========================================================================== */
.main-auth {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.5rem, 1.8vh, 1.25rem) 1rem;
    position: relative;
    min-height: 0;
}

.auth-wrap {
    max-width: 890px;
    width: 100%;
    display: grid;
    grid-template-columns: 1.08fr 1fr;
    gap: clamp(1rem, 2vw, 1.4rem);
    align-items: stretch;
    position: relative;
    z-index: 10;
    animation: smoothFadeInUp 0.4s var(--transition-smooth) forwards;
    will-change: transform, opacity;
}

/* ==========================================================================
   Left Card: Sign-In
   ========================================================================== */
.login-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: clamp(1.2rem, 2.2vh, 1.6rem) clamp(1.2rem, 2vw, 1.7rem);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: transform 0.25s var(--transition-smooth), box-shadow 0.25s var(--transition-smooth);
    will-change: transform, box-shadow;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    background: linear-gradient(90deg, #2563eb, #3b82f6, #6366f1);
}

.login-card:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.07), 0 2px 6px rgba(0, 0, 0, 0.03);
    transform: translateY(-2px);
}

.card-header-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28);
    flex-shrink: 0;
}

.card-header-title {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0;
    line-height: 1.2;
}

.card-header-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.2;
}

.form-label-compact {
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.25rem;
}

.input-compact {
    padding: 0.45rem 0.75rem;
    font-size: 0.88rem;
    border-radius: 0.5rem;
    transition: border-color 0.2s var(--transition-smooth), box-shadow 0.2s var(--transition-smooth);
}

.input-compact:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background-color: #ffffff;
}

.input-group-text-compact {
    padding: 0.45rem 0.7rem;
    font-size: 0.88rem;
    background-color: #f8fafc;
    color: #64748b;
    border-color: #dee2e6;
}

.btn-main-login {
    width: 100%;
    padding: 0.65rem 1.15rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
    border-radius: 0.65rem;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s var(--transition-smooth), box-shadow 0.2s var(--transition-smooth), background 0.2s ease;
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.26);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    will-change: transform, box-shadow;
    min-height: 42px;
}

.btn-main-login:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    color: #ffffff;
}

.btn-main-login:active {
    transform: scale(0.985);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.toggle-password-btn {
    padding: 0.45rem 0.7rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.toggle-password-btn:hover {
    background-color: #f1f5f9;
    color: #2563eb;
}

/* ==========================================================================
   Right Card: Promo Highlights
   ========================================================================== */
.promo-side {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: var(--card-radius);
    padding: clamp(1.2rem, 2.2vh, 1.6rem) clamp(1.2rem, 2vw, 1.7rem);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s var(--transition-smooth), box-shadow 0.25s var(--transition-smooth);
    will-change: transform, box-shadow;
    backface-visibility: hidden;
}

.promo-side:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
}

.promo-side::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.38) 0%, transparent 70%);
    pointer-events: none;
}

.promo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(37, 99, 235, 0.22);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 2rem;
    margin-bottom: 0.45rem;
}

.promo-heading {
    font-size: clamp(1.1rem, 1.45vw, 1.28rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    margin-bottom: 0.45rem;
    letter-spacing: -0.01em;
}

.promo-subtext {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.35;
    margin-bottom: 0.7rem;
}

.promo-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.promo-feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
}

.promo-feature-item i {
    font-size: 0.95rem;
    color: #10b981;
    flex-shrink: 0;
}

.promo-support-bar {
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-top: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.promo-support-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
}

.btn-support-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-support-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: #ffffff;
}

/* ==========================================================================
   Public Footer
   ========================================================================== */
.pub-footer {
    flex-shrink: 0;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 0.55rem 1rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: center;
}

.app-downloads-strip {
    margin-bottom: 0.35rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #f1f5f9;
}

.app-download-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.app-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: #0f172a;
    color: #ffffff !important;
    padding: 0.32rem 0.85rem;
    border-radius: 7px;
    text-decoration: none !important;
    border: 1px solid #1e293b;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
    transition: all 0.2s ease-in-out;
}

.app-download-btn:hover {
    background: #1e293b;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.app-download-btn .btn-subtext {
    display: block;
    font-size: 0.55rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    line-height: 1;
    margin-bottom: 1px;
}

.app-download-btn .btn-maintext {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
}

.copyright-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0;
}

/* ==========================================================================
   Viewport Height & Desktop Fit Constraints (Eliminate Vertical Scroll)
   ========================================================================== */
@media (min-width: 901px) and (min-height: 560px) {
    html, body {
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
    }
    .main-auth {
        overflow: hidden;
    }
}

/* Compact Laptops with Low Screen Heights (e.g. 768px height) */
@media (min-width: 901px) and (max-height: 720px) {
    .pub-header-inner {
        padding: 0.35rem 1.25rem;
    }
    .main-auth {
        padding: 0.4rem 1rem;
    }
    .login-card, .promo-side {
        padding: 1.1rem 1.35rem;
    }
    .promo-heading {
        font-size: 1.12rem;
        margin-bottom: 0.3rem;
    }
    .promo-subtext {
        font-size: 0.74rem;
        margin-bottom: 0.5rem;
    }
    .promo-feature-list {
        gap: 0.35rem;
    }
    .promo-feature-item {
        font-size: 0.76rem;
    }
    .app-downloads-strip {
        display: none;
    }
}

/* ==========================================================================
   Tablet Breakpoints (577px - 900px)
   ========================================================================== */
@media (max-width: 900px) {
    html, body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
    .auth-wrap {
        grid-template-columns: 1fr;
        max-width: 500px;
        gap: 1.25rem;
    }
    .main-auth {
        padding: 1.5rem 1rem;
    }
    .pub-header-inner {
        padding: 0.5rem 1rem;
    }
    .pub-brand {
        gap: 0.55rem;
    }
    .pub-brand .brand-ic {
        width: 30px;
        height: 30px;
        font-size: 0.95rem;
        border-radius: 7px;
    }
    .pub-brand .brand-tx {
        font-size: 1.12rem;
    }
    .brand-divider {
        height: 20px;
        margin: 0 0.15rem;
    }
    .powered-top {
        font-size: 0.6rem;
    }
    .powered-bottom {
        font-size: 0.52rem;
    }
    .pub-header-inner nav, .pub-nav, .pub-actions .btn-pub-primary {
        display: none !important;
    }
    .pub-actions {
        display: flex !important;
    }
    .pub-mobile-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
    .promo-side {
        display: flex !important;
        padding: 1.5rem 1.35rem;
    }
}

/* ==========================================================================
   Mobile Breakpoints (<= 576px)
   ========================================================================== */
@media (max-width: 576px) {
    .brand-divider, .brand-powered {
        display: none !important;
    }
    .main-auth {
        padding: 1rem 0.75rem;
    }
    .auth-wrap {
        gap: 1rem;
    }
    .login-card {
        padding: 1.25rem 1rem;
        border-radius: 0.85rem;
    }
    .promo-side {
        padding: 1.25rem 1rem;
        border-radius: 0.85rem;
    }
    .promo-heading {
        font-size: 1.15rem;
        line-height: 1.3;
    }
    .promo-subtext {
        font-size: 0.76rem;
    }
    .promo-feature-item {
        font-size: 0.76rem;
    }
    .btn-main-login {
        min-height: 44px; /* Accessible touch target */
    }
    .input-compact {
        min-height: 44px;
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.auth-forgot-link {
    font-size: 0.76rem;
}

.auth-remember-label {
    font-size: 0.78rem;
}

