@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #235AED;
    --primary-dark: #1a42b8;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --gray: #e9ecef;
    --dark-text: #2d3748;
    --light-text: #718096;
    --error: #ef4444;
    --shadow: 0 10px 40px rgba(35, 90, 237, 0.15);
    --shadow-lg: 0 20px 60px rgba(35, 90, 237, 0.25);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #235AED 0%, #ffffff 100%);
    height: 100vh;
    width: 100%;
    overflow: hidden;
    color: var(--dark-text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ==================== Animations ==================== */

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes float-slow {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ==================== Main Layout ==================== */

.login-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    z-index: 2;
}

/* Floating Shapes Background */
.floating-shapes {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
    filter: blur(70px);
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: -50px;
    right: -80px;
    animation: float-slow 6s ease-in-out infinite;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--primary-color);
    bottom: 100px;
    left: -100px;
    animation: float 8s ease-in-out infinite;
    animation-delay: 1s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: var(--primary-color);
    bottom: -50px;
    right: 50px;
    animation: float 7s ease-in-out infinite;
    animation-delay: 2s;
}

.shape-4 {
    width: 200px;
    height: 200px;
    background: var(--primary-color);
    top: 200px;
    left: 10%;
    animation: float-slow 9s ease-in-out infinite;
    animation-delay: 0.5s;
}

/* ==================== Login Card ==================== */

.login-card {
    background: white;
    border-radius: 20px;
    padding: 45px 40px;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    z-index: 2;
}

.card-header {
    text-align: center;
    margin-bottom: 35px;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.logo-wrapper {
    margin-bottom: 20px;
}

.logo-img {
    /* width: 65px; */
    height: 65px;
    border-radius: 12px;
    /* box-shadow: 0 8px 24px rgba(35, 90, 237, 0.2); */
    animation: float 3s ease-in-out infinite;
}

.card-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.card-subtitle {
    font-size: 0.95rem;
    color: var(--light-text);
    font-weight: 400;
}

/* ==================== Form Styles ==================== */

.login-form {
    width: 100%;
}

/* Alert Box */
.alert {
    padding: 15px 16px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInDown 0.5s ease-out;
    font-weight: 500;
    font-size: 0.95rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-left: 4px solid var(--error);
}

/* Form Groups */
.form-group {
    margin-bottom: 22px;
    animation: fadeInUp 0.8s ease-out both;
}

.form-group:nth-child(2) {
    animation-delay: 0.2s;
}

.form-group:nth-child(3) {
    animation-delay: 0.3s;
}

.form-group:nth-child(4) {
    animation-delay: 0.4s;
}

.form-group:nth-child(5) {
    animation-delay: 0.5s;
}

.form-label {
    display: block;
    font-size: 0.93rem;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 9px;
    transition: color 0.3s ease;
}

.input-field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.form-input {
    width: 100%;
    padding: 12px 40px 12px 40px;
    font-size: 0.95rem;
    border: 2px solid var(--gray);
    border-radius: 10px;
    background: var(--light-gray);
    color: var(--dark-text);
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.form-input::placeholder {
    color: var(--light-text);
}

.form-input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(35, 90, 237, 0.08);
    transform: translateY(-1px);
}

.form-input:hover {
    border-color: var(--primary-color);
    background: white;
}

.input-icon {
    position: absolute;
    left: 13px;
    color: var(--primary-color);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.3s ease;
    z-index: 2;
}

.form-input:focus ~ .input-icon {
    color: var(--primary-dark);
}

.input-underline {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transition: width 0.3s ease;
    border-radius: 2px;
}

.form-input:focus ~ .input-underline {
    width: 100%;
}

.show-password {
    position: absolute;
    right: 13px;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.show-password:hover {
    color: var(--primary-dark);
    transform: scale(1.15);
}

/* Error Messages */
.error-text {
    display: block !important;
    width: 100%;
    font-size: 0.85rem;
    color: var(--error);
    margin-top: 8px;
    margin-bottom: 0;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.12);
    border-left: 4px solid var(--error);
    border-radius: 4px;
    animation: slideInDown 0.3s ease-out;
    font-weight: 600;
    line-height: 1.4;
    box-sizing: border-box;
}

label.error {
    display: block !important;
    width: 100%;
    font-size: 0.85rem;
    color: var(--error);
    margin-top: 8px;
    margin-bottom: 0;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.12);
    border-left: 4px solid var(--error);
    border-radius: 4px;
    animation: slideInDown 0.3s ease-out;
    font-weight: 600;
    line-height: 1.4;
    box-sizing: border-box;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease;
}

.checkbox-wrapper:hover {
    color: var(--primary-color);
}

.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label {
    font-size: 0.93rem;
    font-weight: 500;
    color: var(--dark-text);
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.93rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.forgot-password::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transition: width 0.3s ease;
}

.forgot-password:hover::after {
    width: 100%;
}

/* Submit Button */
.login-btn {
    width: 100%;
    padding: 13px 20px;
    font-size: 0.98rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow);
    font-family: 'Poppins', sans-serif;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

.login-btn::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;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.login-btn:active {
    transform: translateY(-1px);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    font-weight: 600;
}

.btn-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.login-btn:hover .btn-icon {
    transform: translateX(3px);
}

/* Sign Up Section */
.sign-up-section {
    text-align: center;
    margin-top: 25px;
    font-size: 0.93rem;
    color: var(--light-text);
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.sign-up-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.sign-up-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transition: width 0.3s ease;
}

.sign-up-link:hover::after {
    width: 100%;
}

/* Login Footer */
.login-footer {
    text-align: center;
    /* padding: 20px; */
    color: var(--light-text);
    font-size: 0.8rem;
    margin-top: 20px;
    animation: fadeInUp 0.8s ease-out 0.9s both;
    position: relative;
    z-index: 2;
}

/* ==================== Preloader ==================== */

#preloader {
     position: fixed;
     width: 100%;
     left: 0;
     right: 0;
     top: 0;
     bottom: 0;
     background-color: rgba(255, 255, 255, 0.7);
     z-index: 9999;
     display: none;
 }

 @-webkit-keyframes spin {
     from {
         -webkit-transform: rotate(0deg);
     }

     to {
         -webkit-transform: rotate(360deg);
     }
 }

 @keyframes spin {
     from {
         transform: rotate(0deg);
     }

     to {
         transform: rotate(360deg);
     }
 }

 #preloader::after {
     content: '';
     display: block;
     position: absolute;
     left: 48%;
     top: 40%;
     width: 40px;
     height: 40px;
     border-style: solid;
     border-color: #eee1e1;
     border-top-color: transparent;
     border-width: 4px;
     border-radius: 50%;
     -webkit-animation: spin .8s linear infinite;
     animation: spin .8s linear infinite;
 }
/* ==================== Responsive Design ==================== */

@media (max-width: 768px) {
    .login-card {
        padding: 35px 28px;
        border-radius: 16px;
    }

    .card-header {
        margin-bottom: 28px;
    }

    .logo-img {
        /* width: 55px; */
        height: 55px;
    }

    .card-title {
        font-size: 1.5rem;
    }

    .card-subtitle {
        font-size: 0.9rem;
    }

    .form-input {
        padding: 11px 35px 11px 36px;
        font-size: 0.92rem;
    }

    .input-icon {
        left: 12px;
        font-size: 0.95rem;
    }

    .login-btn {
        padding: 12px 16px;
        font-size: 0.93rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .login-container {
        max-width: 100%;
    }

    .login-card {
        padding: 30px 22px;
        border-radius: 14px;
    }

    .card-header {
        margin-bottom: 24px;
    }

    .logo-img {
        /*width: 50px;*/
        height: 50px;
    }

    .card-title {
        font-size: 1.4rem;
        margin-bottom: 6px;
    }

    .card-subtitle {
        font-size: 0.88rem;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-label {
        font-size: 0.88rem;
        margin-bottom: 7px;
    }

    .form-input {
        padding: 10px 33px 10px 35px;
        font-size: 0.9rem;
    }

    .input-icon {
        left: 11px;
        font-size: 0.9rem;
    }

    .form-options {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        margin-bottom: 22px;
    }

    .login-btn {
        padding: 11px 14px;
        font-size: 0.9rem;
        gap: 8px;
    }

    .btn-icon {
        font-size: 0.95rem;
    }

    .sign-up-section {
        margin-top: 18px;
        font-size: 0.88rem;
    }

    .login-footer {
        padding: 15px;
        font-size: 0.75rem;
        margin-top: 15px;
    }

    .shape {
        opacity: 0.05;
        filter: blur(90px);
    }
}

/* ==================== Accessibility ==================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
