/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #dbeafe 50%, #e0e7ff 100%);
}

/* Animated Background Elements */
.bg-elements {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.bg-circle-1 {
    position: absolute;
    top: -10rem;
    right: -10rem;
    width: 20rem;
    height: 20rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(99, 102, 241, 0.2));
    border-radius: 50%;
    filter: blur(3rem);
    animation: pulse-slow 4s ease-in-out infinite;
}

.bg-circle-2 {
    position: absolute;
    bottom: -10rem;
    left: -10rem;
    width: 24rem;
    height: 24rem;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(59, 130, 246, 0.2));
    border-radius: 50%;
    filter: blur(3rem);
    animation: pulse-slow 4s ease-in-out infinite 1s;
}

.bg-circle-3 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16rem;
    height: 16rem;
    background: linear-gradient(45deg, rgba(168, 85, 247, 0.1), rgba(236, 72, 153, 0.1));
    border-radius: 50%;
    filter: blur(2rem);
    animation: ping 3s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Floating Medical Icons */
.floating-icons {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.floating-icon {
    position: absolute;
    animation: float 6s ease-in-out infinite;
}

.floating-icon:nth-child(1) {
    top: 5rem;
    right: 5rem;
    color: rgba(59, 130, 246, 0.2);
    font-size: 4rem;
    animation-delay: 0.3s;
}

.floating-icon:nth-child(2) {
    top: 10rem;
    left: 5rem;
    color: rgba(20, 184, 166, 0.2);
    font-size: 2.5rem;
    animation-delay: 0.7s;
}

.floating-icon:nth-child(3) {
    bottom: 8rem;
    right: 8rem;
    color: rgba(99, 102, 241, 0.2);
    font-size: 3rem;
    animation-delay: 1s;
}

.floating-icon:nth-child(4) {
    bottom: 5rem;
    left: 10rem;
    color: rgba(168, 85, 247, 0.2);
    font-size: 2rem;
    animation-delay: 0.5s;
}

/* Main Container */
.main-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 75rem;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: slideUp 1s ease-out;
}

.login-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 43.75rem;
}

/* Left Section - Branding */
.branding-section {
    position: relative;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #4f46e5 100%);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
}

.branding-bg-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.4'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    animation: pulse-slow 3s ease-in-out infinite;
}

.branding-content {
    position: relative;
    z-index: 2;
    animation: slideInRight 1s ease-out;
}

.medical-logo {
    position: relative;
    margin-bottom: 2rem;
}

.logo-circle {
    width: 8rem;
    height: 8rem;
    margin: 0 auto 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    font-size: 3rem;
    animation: zoomIn 1s ease-out 0.3s both;
}

.logo-circle i {
    animation: pulse-slow 2s ease-in-out infinite;
}

.check-badge {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    width: 2rem;
    height: 2rem;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    animation: bounce 2s infinite 1s;
}

.branding-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    animation: slideInBottom 1s ease-out 0.5s both;
}

.branding-subtitle {
    color: #bfdbfe;
}

.branding-quote {
    font-size: 1.25rem;
    color: #bfdbfe;
    max-width: 20rem;
    margin: 0 auto 3rem;
    line-height: 1.6;
    animation: slideInBottom 1s ease-out 0.7s both;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    animation: slideInBottom 1s ease-out 0.9s both;
}

.stat-card {
    text-align: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    color: #bfdbfe;
}

/* Right Section - Form */
.form-section {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-container {
    max-width: 28rem;
    margin: 0 auto;
    width: 100%;
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
    animation: slideInLeft 1s ease-out;
}

.form-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.form-subtitle {
    color: #6b7280;
    font-size: 1.1rem;
}

.login-form {
    animation: slideInLeft 1s ease-out 0.2s both;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    color: #374151;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.input-container {
    position: relative;
}

.form-input {
    width: 100%;
    height: 3rem;
    padding: 0 3rem 0 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    background: #f9fafb;
    color: #1f2937;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.form-input:hover {
    border-color: #d1d5db;
}

.input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.1rem;
    z-index: 5;
    transition: all 0.3s ease;
}

.form-input:focus + .input-icon {
    color: #3b82f6;
    transform: translateY(-50%) scale(1.1);
}

.password-toggle {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.3s ease;
    font-size: 1rem;
}

.password-toggle:hover {
    color: #6b7280;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-checkbox {
    width: 1rem;
    height: 1rem;
    accent-color: #3b82f6;
}

.checkbox-label {
    color: #374151;
    cursor: pointer;
    font-size: 0.875rem;
}

.forgot-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.login-button {
    width: 100%;
    height: 3rem;
    background: linear-gradient(135deg, #3b82f6 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.login-button:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #3730a3 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.divider {
    position: relative;
    margin: 1.5rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #d1d5db;
}

.divider-text {
    background: white;
    padding: 0 1rem;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.875rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.social-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.social-button {
    height: 3rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    background: white;
    color: #374151;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.social-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.social-button.google:hover {
    color: #dc2626;
    border-color: #dc2626;
}

.social-button.facebook:hover {
    color: #1877f2;
    border-color: #1877f2;
}

.register-link {
    text-align: center;
    color: #6b7280;
}

.register-link a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.register-link a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.info {
    background: #3b82f6;
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(2rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(2rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-2rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse-slow {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes ping {
    75%, 100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0,-4px,0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .login-grid {
        grid-template-columns: 1fr;
    }
    
    .branding-section {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 0.5rem;
    }
    
    .form-section {
        padding: 2rem 1.5rem;
    }
    
    .form-title {
        font-size: 2rem;
    }
    
    .social-grid {
        grid-template-columns: 1fr;
    }
    
    .floating-icon {
        display: none;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .login-card {
        border: 2px solid #000;
    }
    
    .form-input {
        border: 2px solid #000;
    }
}