* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --neon-green: #00d9a3;
    --dark-green: #00b386;
    --electric-blue: #4f9eff;
    --hot-pink: #ff4d94;
    --bg-light: #f0fff9;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --accent-purple: #a855f7;
    --accent-orange: #ff6b35;
    --accent-yellow: #ffd93d;
}

body {
    font-family: "Outfit", sans-serif;
    background: linear-gradient(135deg, #e0f9f4 0%, #f0fff9 50%, #fff5f0 100%);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Fun Grid Background */
.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 217, 163, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 217, 163, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    z-index: 0;
}

@keyframes gridMove {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(50px);
    }
}

/* Floating Gradient Orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 217, 163, 0.6), transparent);
    top: 10%;
    left: 10%;
    animation: float1 15s infinite ease-in-out;
}

.orb-2 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(79, 158, 255, 0.5), transparent);
    bottom: 10%;
    right: 10%;
    animation: float2 18s infinite ease-in-out;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 77, 148, 0.4), transparent);
    top: 50%;
    right: 30%;
    animation: float3 20s infinite ease-in-out;
}

@keyframes float1 {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(50px, -80px) scale(1.1);
    }
    66% {
        transform: translate(-30px, 60px) scale(0.9);
    }
}

@keyframes float2 {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(-60px, 40px) scale(0.9);
    }
    66% {
        transform: translate(40px, -50px) scale(1.1);
    }
}

@keyframes float3 {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(60px, 80px) scale(1.15);
    }
}

/* Medical Icons Floating */
.floating-icons {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

.float-icon {
    position: absolute;
    font-size: 2rem;
    opacity: 0.15;
    animation: floatRandom 15s infinite ease-in-out;
    color: var(--dark-green);
}

.float-icon:nth-child(1) {
    top: 15%;
    left: 15%;
    animation-delay: 0s;
}

.float-icon:nth-child(2) {
    top: 25%;
    right: 20%;
    animation-delay: 2s;
    color: var(--electric-blue);
}

.float-icon:nth-child(3) {
    bottom: 20%;
    left: 10%;
    animation-delay: 4s;
}

.float-icon:nth-child(4) {
    bottom: 30%;
    right: 15%;
    animation-delay: 6s;
    color: var(--hot-pink);
}

.float-icon:nth-child(5) {
    top: 50%;
    left: 8%;
    animation-delay: 3s;
    color: var(--accent-purple);
}

.float-icon:nth-child(6) {
    top: 60%;
    right: 12%;
    animation-delay: 5s;
    color: var(--accent-orange);
}

@keyframes floatRandom {
    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(20px, -30px) rotate(5deg);
    }
    50% {
        transform: translate(-15px, 40px) rotate(-5deg);
    }
    75% {
        transform: translate(30px, 20px) rotate(3deg);
    }
}

.container {
    position: relative;
    z-index: 10;
}

/* Login Card - OPTIMIZED FOR VIEWPORT */
.login-wrapper,
.reset-wrapper {
    animation: slideInScale 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 95vh;
}

@keyframes slideInScale {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.login-card,
.reset-card {
    background: var(--bg-card);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(0, 217, 163, 0.2);
    box-shadow:
        0 0 60px rgba(0, 217, 163, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.1);
    max-height: 95vh;
}

.login-card::before,
.reset-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--neon-green),
        var(--electric-blue),
        var(--hot-pink),
        var(--accent-purple),
        var(--accent-orange),
        var(--neon-green)
    );
    background-size: 200% 100%;
    animation: rainbowSlide 4s linear infinite;
}

@keyframes rainbowSlide {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 200% 0%;
    }
}

/* Left Panel - REDUCED PADDING */
.left-panel {
    background: linear-gradient(135deg, #e0f9f4 0%, #d5f5ed 100%);
    position: relative;
    overflow: hidden;
    padding: 2rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.neon-border {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px solid var(--neon-green);
    border-radius: 16px;
    opacity: 0.4;
    animation: borderPulse 2s ease-in-out infinite;
}

@keyframes borderPulse {
    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02);
    }
}

.logo-section {
    position: relative;
    z-index: 2;
    text-align: center;
}

.logo-image-wrapper {
    width: 300px;
    margin: 0 auto 1.5rem;
    position: relative;
    animation:
        fadeIn 1s ease-out 0.3s both,
        float 6s ease-in-out infinite;
}

.logo-image {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0, 217, 163, 0.3));
    animation: logoGlow 3s ease-in-out infinite;
}

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

@keyframes logoGlow {
    0%,
    100% {
        filter: drop-shadow(0 5px 15px rgba(0, 217, 163, 0.3));
    }
    50% {
        filter: drop-shadow(0 8px 25px rgba(0, 217, 163, 0.5));
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* REDUCED STATS GRID MARGIN */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
    animation: slideInLeft 0.8s ease-out 0.7s both;
}

.stat-item {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 2px solid rgba(0, 217, 163, 0.2);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--neon-green);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 217, 163, 0.2);
}

.stat-icon {
    font-size: 1.25rem;
    color: var(--neon-green);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Right Panel - REDUCED PADDING */
.right-panel {
    padding: 2.5rem 2.5rem;
    position: relative;
    background: #ffffff;
    overflow-y: auto;
    max-height: 95vh;
}

.welcome-section {
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.8s ease-out;
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--dark-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-emoji {
    display: inline-block;
    animation: wave 2s ease-in-out infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0%,
    100% {
        transform: rotate(0deg);
    }
    10%,
    30% {
        transform: rotate(14deg);
    }
    20%,
    40% {
        transform: rotate(-8deg);
    }
    50% {
        transform: rotate(10deg);
    }
    60% {
        transform: rotate(0deg);
    }
}

.welcome-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Alert Styles - REDUCED PADDING */
.alert {
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    animation: slideDown 0.5s ease-out;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(0, 217, 163, 0.1);
    color: var(--dark-green);
    border: 2px solid rgba(0, 217, 163, 0.3);
}

.alert-danger {
    background: rgba(255, 77, 148, 0.1);
    color: #d91f5e;
    border: 2px solid rgba(255, 77, 148, 0.3);
}

/* Form Styles - REDUCED MARGINS */
.form-group {
    margin-bottom: 1.25rem;
    animation: fadeInUp 0.6s ease-out both;
}

.form-group:nth-child(1) {
    animation-delay: 0.2s;
}

.form-group:nth-child(2) {
    animation-delay: 0.3s;
}

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

.form-label {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neon-green);
    z-index: 10;
    font-size: 1rem;
}

.form-control {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px !important;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    width: 100%;
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-control:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--neon-green);
    box-shadow: 0 0 0 4px rgba(0, 217, 163, 0.1);
}

.form-control.is-invalid {
    border-color: #ef4444;
}

.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s ease;
    font-size: 1rem;
}

.toggle-password:hover {
    color: var(--neon-green);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background: var(--neon-green);
    border-color: var(--neon-green);
}

.form-check-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
}

.forgot-link,
.back-link {
    color: var(--neon-green);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.forgot-link::after,
.back-link::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--neon-green);
    transition: width 0.3s ease;
}

.forgot-link:hover,
.back-link:hover {
    color: var(--electric-blue);
}

.forgot-link:hover::after,
.back-link:hover::after {
    width: 100%;
}

.btn-login,
.btn-reset {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, var(--neon-green), var(--dark-green));
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out 0.5s both;
    box-shadow: 0 4px 15px rgba(0, 217, 163, 0.3);
}

.btn-login::before,
.btn-reset::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition:
        width 0.6s,
        height 0.6s;
}

.btn-login:hover,
.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 217, 163, 0.5);
}

.btn-login:active,
.btn-reset:active {
    transform: translateY(0);
}

.btn-login-text,
.btn-reset-text {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.footer-text,
.back-text {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    animation: fadeIn 1s ease-out 0.8s both;
}

.footer-text i {
    color: var(--neon-green);
}

.back-text {
    font-size: 0.9rem;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

/* Lock Icon */
.lock-icon-wrapper {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(
        135deg,
        var(--neon-green),
        var(--electric-blue)
    );
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconPulse 3s ease-in-out infinite;
    box-shadow: 0 10px 30px rgba(0, 217, 163, 0.3);
}

@keyframes iconPulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(0, 217, 163, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(0, 217, 163, 0.5);
    }
}

.lock-icon i,
.key-icon i {
    font-size: 3rem;
    color: white;
}

.lock-icon,
.key-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Password Strength Indicator */
.strength-wrapper {
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.strength-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-fill {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.strength-fill.weak {
    background: #ef4444;
    width: 25%;
}

.strength-fill.medium {
    background: #f59e0b;
    width: 50%;
}

.strength-fill.good {
    background: #3b82f6;
    width: 75%;
}

.strength-fill.strong {
    background: var(--neon-green);
    width: 100%;
}

.strength-text {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.form-text-small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Loading Animation */
.btn-loading {
    pointer-events: none;
}

.btn-loading .btn-login-text,
.btn-loading .btn-reset-text {
    opacity: 0;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 991px) {
    .left-panel {
        display: none;
    }

    .right-panel {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 576px) {
    .right-panel {
        padding: 1.5rem 1.25rem;
    }

    .welcome-title {
        font-size: 1.5rem;
    }

    .logo-image-wrapper {
        width: 150px;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .lock-icon-wrapper {
        width: 80px;
        height: 80px;
    }

    .lock-icon i,
    .key-icon i {
        font-size: 2.5rem;
    }
}
