        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            /* font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; */
            background-size: cover;
            background-attachment: fixed;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
        }

        /* Animated background overlay */
        body::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(45deg,
                    rgba(30, 87, 153, 0.7) 0%,
                    rgba(32, 124, 202, 0.7) 50%,
                    rgba(30, 87, 153, 0.7) 100%);
            background-size: 400% 400%;
            animation: gradientShift 15s ease infinite;
            z-index: -1;
        }

        @keyframes gradientShift {
            0% {
                background-position: 0% 50%;
            }

            50% {
                background-position: 100% 50%;
            }

            100% {
                background-position: 0% 50%;
            }
        }

        .login-container {
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 18px;
            box-shadow: 0 18px 36px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.08);
            overflow: hidden;
            width: 100%;
            max-width: 820px;
            min-height: 520px;
            display: flex;
            position: relative;
            animation: slideUp 0.6s ease-out;
        }

        .login-container.flipped {
            flex-direction: row-reverse;
        }

        .login-container.transitioning {
            pointer-events: none;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(50px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .login-left {
            flex: 1;
            background: linear-gradient(135deg, rgba(30, 87, 153, 0.9) 0%, rgba(32, 124, 202, 0.9) 100%);
            /* backdrop-filter: blur(10px); */
            color: white;
            padding: 2.25rem 1.75rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
            text-align: center;
            position: relative;
            overflow: hidden;
            transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .login-right {
            flex: 1;
            padding: 2.25rem 1.75rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
            background: rgba(255, 255, 255, 0.95);
            /* backdrop-filter: blur(10px); */
            transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* Form transitions */
        .form-container {
            position: relative;
            width: 100%;
            height: 100%;
            min-height: 360px;
            /* ensure space for the form when panels stack */
        }

        .login-form,
        .forgot-form {
            position: absolute;
            width: 100%;
            transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
            opacity: 1;
            transform: translateX(0);
        }

        .login-form.slide-out-left {
            opacity: 0;
            transform: translateX(-100%);
        }

        .forgot-form {
            opacity: 0;
            transform: translateX(100%);
        }

        .forgot-form.slide-in {
            opacity: 1;
            transform: translateX(0);
        }

        .forgot-form.slide-out {
            opacity: 0;
            transform: translateX(-100%);
        }

        .branding-content {
            transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
            opacity: 1;
            transform: translateY(0);
        }

        .branding-content.fade-out {
            opacity: 0;
            transform: translateY(-20px);
        }

        .forgot-branding {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            opacity: 0;
            transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
            text-align: center;
            width: 100%;
        }

        .forgot-branding.fade-in {
            opacity: 1;
        }

        .login-left::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="a" cx="50%" cy="50%" r="50%"><stop offset="0%" style="stop-color:rgba(255,255,255,0.1);stop-opacity:1" /><stop offset="100%" style="stop-color:rgba(255,255,255,0);stop-opacity:0" /></radialGradient></defs><circle cx="20%" cy="20%" r="10%" fill="url(%23a)" /><circle cx="80%" cy="30%" r="8%" fill="url(%23a)" /><circle cx="30%" cy="70%" r="12%" fill="url(%23a)" /><circle cx="70%" cy="80%" r="6%" fill="url(%23a)" /></svg>') no-repeat;
            background-size: cover;
            animation: float 20s ease-in-out infinite;
            opacity: 0.3;
            z-index: 0;
        }

        @keyframes float {

            0%,
            100% {
                transform: translate(0, 0) rotate(0)
            }

            33% {
                transform: translate(30px, -30px) rotate(120deg)
            }

            66% {
                transform: translate(-20px, 20px) rotate(240deg)
            }
        }

        .clinic-logo {
            width: 80px;
            height: 80px;
            background: rgba(255, 255, 255, 0.25);
            /* backdrop-filter: blur(10px); */
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            margin: 0 auto 1.25rem;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            font-weight: 700;
            position: relative;
            z-index: 1;
            transition: all 0.3s ease;
            animation: pulse 3s ease-in-out infinite;
        }

        @keyframes pulse {

            0%,
            100% {
                transform: scale(1);
                box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4)
            }

            50% {
                transform: scale(1.05);
                box-shadow: 0 0 0 20px rgba(255, 255, 255, 0)
            }
        }

        .login-left h1 {
            font-size: 2rem;
            margin-bottom: 0.75rem;
            font-weight: 700;
            position: relative;
            z-index: 1;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .login-left p {
            font-size: 1rem;
            opacity: 0.95;
            line-height: 1.5;
            position: relative;
            z-index: 1;
            font-weight: 400;
        }

        .login-form h2 {
            color: #1a1a1a;
            margin-bottom: 0.5rem;
            font-size: 1.75rem;
            font-weight: 700;
            text-align: center;
        }

        .login-subtitle {
            color: #6b7280;
            font-size: 0.95rem;
            text-align: center;
            margin-bottom: 1.5rem;
            font-weight: 400;
        }

        .form-group {
            margin-bottom: 1.25rem;
            position: relative;
        }

        .form-group label {
            position: absolute;
            left: 2.5rem;
            top: 0.9rem;
            color: #9ca3af;
            font-size: 0.9rem;
            font-weight: 500;
            transition: all 0.3s ease;
            pointer-events: none;
            background: transparent;
            z-index: 1;
        }

        .form-group.focused label,
        .form-group.filled label {
            transform: translateY(-2rem) scale(0.85);
            color: #1e5799;
            background: rgba(255, 255, 255, 0.9);
            padding: 0 0.35rem;
            border-radius: 4px;
        }

        .input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }

        .input-icon {
            position: absolute;
            left: 0.9rem;
            color: #9ca3af;
            font-size: 1rem;
            z-index: 2;
            transition: color 0.3s ease;
        }

        .form-control {
            width: 100%;
            padding: 0.875rem 0.875rem 0.875rem 2.5rem;
            border: 1.5px solid #e5e7eb;
            border-radius: 10px;
            font-size: 0.95rem;
            font-weight: 400;
            transition: all 0.3s ease;
            outline: none;
            background: rgba(255, 255, 255, 0.85);
            /* backdrop-filter: blur(5px); */
        }

        .form-control:focus {
            border-color: #1e5799;
            background: rgba(255, 255, 255, 0.95);
            box-shadow: 0 0 0 4px rgba(30, 87, 153, 0.1);
            transform: translateY(-1px);
        }

        .form-control:focus+.input-icon {
            color: #1e5799;
        }

        .password-toggle {
            position: absolute;
            right: 0.5rem;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: #9ca3af;
            cursor: pointer;
            font-size: 1.1rem;
            transition: all 0.3s ease;
            z-index: 3;
            padding: 0.6rem;
            border-radius: 6px;
            min-width: 2.5rem;
            min-height: 2.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .password-toggle:hover {
            color: #1e5799;
            background: rgba(59, 130, 246, 0.1);
            transform: translateY(-50%) scale(1.05);
        }

        .password-toggle:focus {
            outline: none;
            color: #1e5799;
            background: rgba(59, 130, 246, 0.15);
            box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
        }

        .password-toggle:active {
            transform: translateY(-50%) scale(0.95);
            background: rgba(59, 130, 246, 0.2);
        }

        .password-field-wrapper {
            position: relative;
        }

        .password-field-wrapper .form-control {
            padding-right: 3.5rem;
        }

        .checkbox-wrapper {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin: 1rem 0;
        }

        .custom-checkbox {
            position: relative;
            display: flex;
            align-items: center;
            cursor: pointer;
        }

        .custom-checkbox input {
            position: absolute;
            opacity: 0;
            cursor: pointer;
        }

        .checkmark {
            height: 20px;
            width: 20px;
            background: rgba(255, 255, 255, 0.8);
            border: 2px solid #e5e7eb;
            border-radius: 4px;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .custom-checkbox input:checked~.checkmark {
            background: #1e5799;
            border-color: #1e5799;
        }

        .checkmark:after {
            content: "\2713";
            font-family: inherit;
            font-weight: bold;
            color: white;
            font-size: 12px;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .custom-checkbox input:checked~.checkmark:after {
            opacity: 1;
        }

        .btn-login {
            width: 100%;
            padding: 0.9rem;
            background: linear-gradient(135deg, #1e5799 0%, #207cca 100%);
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-top: 0.75rem;
            position: relative;
            overflow: hidden;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .btn-login::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s ease;
        }

        .btn-login:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(30, 87, 153, 0.4);
        }

        .btn-login:hover::before {
            left: 100%;
        }

        .btn-login:active {
            transform: translateY(0);
        }

        .alert {
            padding: 1rem 1.5rem;
            border-radius: 12px;
            margin-bottom: 2rem;
            border: none;
            font-weight: 500;
        }

        .alert-danger {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
            border: 1px solid rgba(239, 68, 68, 0.2);
            color: #dc2626;
            backdrop-filter: blur(10px);
        }

        .forgot-password,
        .back-to-login {
            text-align: center;
            margin-top: 2rem;
        }

        .forgot-password a,
        .back-to-login a {
            color: #1e5799;
            text-decoration: none;
            font-size: 0.95rem;
            font-weight: 500;
            transition: all 0.3s ease;
            position: relative;
        }

        .forgot-password a::after,
        .back-to-login a::after {
            content: '';
            position: absolute;
            width: 0;
            height: 2px;
            bottom: -2px;
            left: 50%;
            background: #1e5799;
            transition: all 0.3s ease;
            transform: translateX(-50%);
        }

        .forgot-password a:hover::after,
        .back-to-login a:hover::after {
            width: 100%;
        }

        .forgot-password a:hover,
        .back-to-login a:hover {
            color: #207cca;
        }

        /* Loading states */
        .btn-login.loading {
            pointer-events: none;
            opacity: 0.7;
            position: relative;
        }

        .btn-login.loading::after {
            content: '';
            position: absolute;
            width: 16px;
            height: 16px;
            margin: auto;
            border: 2px solid transparent;
            border-top: 2px solid #ffffff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

        .btn-login.loading .btn-text {
            opacity: 0;
        }

        @keyframes spin {
            0% {
                transform: translate(-50%, -50%) rotate(0deg);
            }

            100% {
                transform: translate(-50%, -50%) rotate(360deg);
            }
        }

        .alert-success {
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(22, 163, 74, 0.1));
            border: 1px solid rgba(34, 197, 94, 0.2);
            color: #16a34a;
            backdrop-filter: blur(10px);
        }

        .alert-warning {
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
            border: 1px solid rgba(245, 158, 11, 0.2);
            color: #d97706;
            backdrop-filter: blur(10px);
        }

        .processing-message {
            text-align: center;
            color: #6b7280;
            font-size: 0.85rem;
            margin-top: 0.5rem;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .processing-message.show {
            opacity: 1;
        }

        @media (max-width: 768px) {
            body {
                overflow-y: auto;
                /* allow scroll on small screens */
                align-items: flex-start;
                /* don't vertically center tall content */
                background-attachment: scroll;
                /* better mobile perf */
            }

            .login-container {
                flex-direction: column;
                margin: 1rem auto;
                width: 92%;
                max-width: 540px;
                min-height: auto;
                border-radius: 16px;
                overflow: visible;
                /* allow content like forgot link to be visible */
            }

            .login-left {
                padding: 1.5rem 1.125rem;
                min-height: 220px;
                align-items: center;
                text-align: center;
            }

            .login-right {
                padding: 1.5rem 1.125rem;
                display: flex;
                flex-direction: column;
                align-items: center;
            }

            .login-left h1 {
                font-size: 1.6rem;
            }

            .clinic-logo {
                width: 64px;
                height: 64px;
                font-size: 1.5rem;
            }

            .form-control {
                padding: 0.8rem 0.8rem 0.8rem 2.25rem;
                font-size: 0.95rem;
                border-radius: 10px;
            }

            .btn-login {
                padding: 0.8rem;
                font-size: 0.95rem;
                border-radius: 10px;
            }

            /* Stack forms on mobile and animate between them */
            .form-container {
                min-height: initial;
                height: auto;
                width: 100%;
                max-width: 480px;
                margin: 0 auto;
            }

            .login-form,
            .forgot-form {
                position: static;
                transition: opacity 0.3s ease, max-height 0.3s ease, transform 0.3s ease;
            }

            /* Defaults */
            .login-form {
                opacity: 1;
                max-height: 1000px;
                /* enough for content */
                transform: translateX(0);
            }

            .forgot-form {
                opacity: 0;
                max-height: 0;
                overflow: hidden;
                pointer-events: none;
                transform: translateX(10px);
            }

            /* Toggled states from existing JS classes */
            .forgot-form.slide-in {
                opacity: 1;
                max-height: 1000px;
                pointer-events: auto;
                transform: translateX(0);
            }

            .login-form.slide-out-left {
                opacity: 0;
                max-height: 0;
                pointer-events: none;
                transform: translateX(-10px);
            }

            /* Branding/logo toggle on mobile */
            .login-container.flipped {
                flex-direction: column;
            }

            .login-left .branding-content,
            .login-left .forgot-branding {
                transition: opacity 0.3s ease, transform 0.3s ease;
            }

            /* Default: show login branding */
            .login-left .branding-content {
                opacity: 1;
                transform: none;
                display: block;
            }

            .login-left .forgot-branding {
                opacity: 0;
                transform: none;
                display: none;
            }

            /* When flipped: show forgot branding */
            .login-container.flipped .login-left .branding-content {
                opacity: 0;
                display: none;
            }

            .login-container.flipped .login-left .forgot-branding {
                opacity: 1;
                display: block;
            }

            /* Ensure branding blocks are centered on mobile and not absolutely positioned */
            .login-left .branding-content,
            .login-left .forgot-branding {
                width: 100%;
            }

            .login-left .forgot-branding {
                position: static;
                top: auto;
                left: auto;
                transform: none;
            }
        }

        @media (max-width: 480px) {
            .login-container {
                margin: 0.5rem auto;
                width: 94%;
                max-width: 380px;
                border-radius: 14px;
                overflow: visible;
            }

            .form-container {
                min-height: 320px;
            }

            .login-left {
                padding: 1rem 0.875rem;
                min-height: 200px;
            }

            .login-right {
                padding: 1rem 0.875rem;
            }

            .login-form h2,
            .login-left h1 {
                font-size: 1.45rem;
            }

            .login-left p:nth-of-type(2),
            .forgot-branding p:nth-of-type(2) {
                display: none;
            }

            .form-group {
                margin-bottom: 0.875rem;
            }

            .form-group label {
                left: 2rem;
                top: 0.7rem;
                font-size: 0.85rem;
            }

            .form-control {
                padding: 0.7rem 0.75rem 0.7rem 2rem;
                font-size: 0.9rem;
                border-radius: 9px;
            }

            .input-icon {
                left: 0.75rem;
                font-size: 0.95rem;
            }

            .btn-login {
                padding: 0.75rem;
                font-size: 0.9rem;
                border-radius: 9px;
            }

            /* Inherit stacked form animations from <=768px */
        }

        @media (max-width: 360px) {
            .login-container {
                width: 96%;
                max-width: 320px;
                margin: 0.5rem auto;
                overflow: visible;
            }

            .form-container {
                min-height: 300px;
            }

            .clinic-logo {
                width: 56px;
                height: 56px;
                font-size: 1.3rem;
            }

            .login-form h2,
            .login-left h1 {
                font-size: 1.3rem;
            }

            .form-control {
                padding: 0.65rem 0.65rem 0.65rem 1.85rem;
                font-size: 0.875rem;
                border-radius: 8px;
            }

            .btn-login {
                padding: 0.7rem;
                font-size: 0.875rem;
                border-radius: 8px;
            }

            /* Inherit stacked form animations from <=768px */
        }