/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(120deg, #8b4513, #d2691e);
    background-image: url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
}

.container {
    position: relative;
    width: 400px;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.8s ease-out;
    overflow: hidden;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
    color: #8b4513;
    animation: float 3s ease-in-out infinite;
}

.logo i {
    font-size: 40px;
    margin-bottom: 10px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.logo:hover i {
    transform: rotate(360deg);
}

.logo h1 {
    font-size: 24px;
    font-weight: 600;
}

.form-section {
    transition: all 0.5s ease;
    animation: slideIn 0.5s ease-out;
}

.form-section.hide {
    display: none;
}

h2 {
    text-align: center;
    margin-bottom: 10px;
    color: #8b4513;
    font-size: 24px;
    animation: fadeIn 0.5s ease-out;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    font-size: 14px;
    animation: fadeIn 0.5s ease-out 0.2s backwards;
}

.input-field {
    position: relative;
    height: 50px;
    margin: 15px 0;
    animation: fadeIn 0.5s ease-out;
}

.input-field input {
    width: 100%;
    height: 100%;
    padding: 0 35px;
    border: none;
    outline: none;
    border-bottom: 2px solid #d2691e;
    font-size: 16px;
    transition: all 0.3s ease;
    background: transparent;
}

.input-field input:focus {
    border-bottom-color: #8b4513;
}

.input-field input:focus + i {
    color: #8b4513;
    transform: translateY(-50%) scale(1.1);
}

.input-field i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #d2691e;
    transition: all 0.3s ease;
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    font-size: 14px;
    animation: fadeIn 0.5s ease-out 0.4s backwards;
}

.remember-forgot label {
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.remember-forgot label:hover {
    color: #8b4513;
}

.remember-forgot a {
    color: #8b4513;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.remember-forgot a:hover {
    color: #d2691e;
}

.btn {
    width: 100%;
    height: 45px;
    background: #8b4513;
    border: none;
    outline: none;
    border-radius: 5px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    animation: fadeIn 0.5s ease-out 0.6s backwards;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: #d2691e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.switch-form {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
    animation: fadeIn 0.5s ease-out 0.8s backwards;
}

.switch-form a {
    color: #8b4513;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.switch-form a:hover {
    color: #d2691e;
    text-decoration: underline;
}

.error-message {
    color: #ff3333;
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
    min-height: 20px;
    animation: shake 0.5s ease-in-out;
}

/* Input animation */
.input-field input:not(:placeholder-shown) + i {
    color: #8b4513;
}

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

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
