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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    position: relative;
}

.login-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-top: 140px; 
}

/* Animated background elements */
body::before,
body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(230, 57, 70, 0.1) 0%, transparent 70%);
    animation: float 8s ease-in-out infinite;
}

body::before {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
}

body::after {
    width: 300px;
    height: 300px;
    bottom: -50px;
    left: -50px;
    animation-delay: -4s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, 30px) scale(1.1);
    }
}

.login-wrapper {
    position: relative;
}

.back-button {
    position: absolute;
    top: -50px;
    left: 6px;
}

.back-button {
    margin-top: 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    z-index: 10;
    animation: slideInLeft 0.6s ease;
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.back-button:hover {
    color: #e63946;
    transform: translateX(-5px);
}

.back-button::before {
    content: '←';
    font-size: 1.2rem;
}

.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    overflow: hidden;
    animation: fadeInUp 0.8s ease;
    position: relative;
    z-index: 1;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    background: linear-gradient(135deg, #e63946 0%, #ff6b7a 100%);
    padding: 50px 40px;
    padding-top:30px;
    height: 245px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.05)"/></svg>');
    animation: slidePattern 20s linear infinite;
}

@keyframes slidePattern {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(100px);
    }
}

.blood-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.563);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5rem;
    animation: pulse 2s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@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 15px rgba(255, 255, 255, 0);
    }
}

.login-header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.8s ease 0.3s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.login-header p {
    font-size: 1.1rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.8s ease 0.5s both;
}

.login-form {
    width: 450px;
    padding: 50px;
    padding-top: 30px;
}

.form-group {
    margin-bottom: 25px;
    animation: slideInRight 0.6s ease both;
}

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

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.password-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.forgot-password {
    color: #e63946;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

.forgot-password:hover {
    color: #d62839;
    text-decoration: underline;
}

.form-input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1.05rem;
    transition: all 0.3s;
    background: #fafafa;
}

.form-input:focus {
    outline: none;
    border-color: #e63946;
    background: white;
    box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.1);
    transform: translateY(-2px);
}

.form-input::placeholder {
    color: #999;
}

.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.toggle-password:hover {
    color: #e63946;
}

.login-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #e63946 0%, #ff6b7a 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    animation: slideInRight 0.6s ease 0.4s both;
}

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

.login-button:hover::before {
    width: 300px;
    height: 300px;
}

.login-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(230, 57, 70, 0.4);
}

.login-button:active {
    transform: translateY(-1px);
}

.signup-text {
    text-align: center;
    margin-top: 25px;
    color: #666;
    font-size: 0.95rem;
    animation: fadeIn 0.8s ease 0.6s both;
}

.signup-text a {
    color: #e63946;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.signup-text a:hover {
    color: #d62839;
    text-decoration: underline;
}

/* Loading animation */
.login-button.loading {
    pointer-events: none;
    opacity: 0.8;
}

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

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

/* Input animation on focus */
.form-group.focused label {
    color: #e63946;
}

/* Shake animation for errors */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.form-input.error {
    border-color: #ff4444;
    animation: shake 0.5s;
}

/* Responsive */
@media (max-width: 768px) {
    .back-button {
        top: 20px;
        left: 20px;
    }

    .login-header {
        padding: 40px 30px;
    }

    .login-form {
        padding: 30px 25px;
    }
}