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

:root {
    --primary-red: #e63946;
    --dark-red: #d00000;
    --light-red: #ff5a5f;
    --pale-red: #ffebee;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #6c757d;
    --black: #212529;
    --shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 15px 40px rgba(230, 57, 70, 0.15);
}

.preload * {
    animation: none !important;
    transition: none !important;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--black);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}


/* Background container */
.bg-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none; /* so it doesn't block clicks */
}

/* Blob base style */
.blob {
    position: absolute;
    border-radius: 50%;
    background: var(--pale-red);
    opacity: 0.6;
    filter: blur(50px);
    transform: scale(1);
    animation: float 10s ease-in-out infinite alternate;
    transition: transform 0.5s ease, filter 0.5s ease;
}

/* Different sizes and positions */
.blob-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -100px;
    animation-duration: 12s;
    background: radial-gradient(circle at 30% 30%, #ff7b7b, #ff3d3d);
}

.blob-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: -50px;
    animation-duration: 8s;
    background: radial-gradient(circle at 50% 50%, #ff9e7b, #ff5a3d);
}

.blob-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 5%;
    animation-duration: 10s;
    background: radial-gradient(circle at 70% 70%, #ffb37b, #ff6a3d);
}

/* Floating animation */
@keyframes float {
    0% { transform: translate(0,0) scale(1); border-radius: 50% 60% 40% 50%; }
    25% { transform: translate(30px, -20px) scale(1.1); border-radius: 60% 40% 50% 50%; }
    50% { transform: translate(-20px, 30px) scale(0.9); border-radius: 50% 50% 60% 40%; }
    75% { transform: translate(20px, -30px) scale(1.05); border-radius: 40% 50% 50% 60%; }
    100% { transform: translate(0,0) scale(1); border-radius: 50% 60% 40% 50%; }
}

/* Hover effect */
.blob:hover {
    transform: scale(1.2) translate(10px, -10px);
    filter: blur(30px);
    cursor: pointer;
}


/* Main container */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    padding: 20px;
}

/* Login card */
.login-card {
    display: flex;
    background: var(--white);
    border-radius: 20px;    
    overflow: hidden;
    box-shadow: var(--shadow);
    animation: cardEntrance 0.8s ease-out;
    transition: box-shadow 0.3s ease;
}

.login-card:hover {
    box-shadow: var(--shadow-hover);
}


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


/* Left side - Branding */
.brand-side {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.brand-side::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.2;
    animation: subtleMove 20s linear infinite;
}

@keyframes subtleMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 30px); }
}

.logo-container {
    text-align: center;
    z-index: 1;
    position: relative;
}

.logo {
    width: 220px;
    height: 220px;
    background: var(--white);
    border-radius: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
    /* animation: logoFloat 3s ease-in-out infinite; */
    overflow: hidden;
}

.logo img {
    width: 70%;
    height: auto;
    object-fit: contain;
}


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

.logo i {
    font-size: 40px;
    color: var(--primary-red);
}


.brand-text h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.brand-text p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    max-width: 300px;
    line-height: 1.5;
}

.features {
    margin-top: 30px;
    z-index: 1;
    position: relative;
}

.feature {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInLeft 0.6s ease-out forwards;
}

.feature:nth-child(1) { animation-delay: 0.3s; }
.feature:nth-child(2) { animation-delay: 0.5s; }
.feature:nth-child(3) { animation-delay: 0.7s; }

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

.feature i {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
    font-size: 12px;
}

/* Right side - Login form */
.form-side {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-header {
    margin-bottom: 40px;
    text-align: center;
}

.form-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--black);
}

.form-header p {
    color: var(--dark-gray);
    font-size: 0.85rem;
}

.form-group {
    position: relative;
    margin-bottom: 30px;
}

.form-group label {
    position: absolute;
    top: 10px;
    left: 20px;
    color: var(--dark-gray);
    font-size: 0.85rem;
    transition: all 0.3s ease;
    pointer-events: none;
    background: var(--white);
    padding: 0 8px;
}

.form-control {
    width: 100%;
    padding: 9px 20px;
    background: var(--white);
    border: 2px solid var(--medium-gray);
    border-radius: 12px;
    color: var(--black);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.form-control:focus + label,
.form-control:not(:placeholder-shown) + label {
    top: -10px;
    font-size: 0.85rem;
    color: var(--primary-red);
}

.form-control::placeholder {
    color: transparent;
}

.password-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--dark-gray);
    cursor: pointer;
    transition: color 0.3s;
}

.password-toggle:hover {
    color: var(--primary-red);
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 0.85rem;
}

.remember {
    display: flex;
    align-items: center;
}

.remember input {
    margin-right: 8px;
    accent-color: var(--primary-red);
}

.remember label {
    color: var(--dark-gray);
}

.forgot-password {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s;
    position: relative;
}

.forgot-password::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary-red);
    left: 0;
    bottom: -2px;
    transition: width 0.3s ease;
}

.forgot-password:hover::after {
    width: 100%;
}

.login-btn {
    width: 100%;
    padding: 9px;
    background: var(--primary-red);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.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.7s;
}

.login-btn:hover {
    background: var(--dark-red);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(230, 57, 70, 0.2);
}

.login-btn:hover::before {
    left: 100%;
}

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

.divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
    color: var(--dark-gray);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--medium-gray);
}

.divider span {
    padding: 0 15px;
    font-size: 0.85rem;
}

.social-login {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--medium-gray);
    background: var(--white);
    color: var(--dark-gray);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.social-btn:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(230, 57, 70, 0.1);
}

.signup-link {
    text-align: center;
    font-size: 0.9rem;
    color: var(--dark-gray);
}

.signup-link a {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    position: relative;
}

.signup-link a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary-red);
    left: 0;
    bottom: -2px;
    transition: width 0.3s ease;
}

.signup-link a:hover::after {
    width: 100%;
}

.error-message {
    color: red;          /* text color */
    text-align: center;  /* center it */
    margin-bottom: 20px; /* spacing before the form */
}


.version {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 0.75rem;
    color: var(--dark-gray);
    z-index: 1;
    margin-right: 20px;
    margin-bottom: 20px;
}

.form-for-login {
    position: relative;
    margin-left: 50px;
    margin-right: 50px;
}

/* Alert messages */
.alert {
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: none;
    animation: slideDown 0.5s ease-out;
    border-left: 4px solid;
}

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

.alert-error {
    background: #ffebee;
    border-left-color: var(--primary-red);
    color: #c62828;
}

.alert-success {
    background: #e8f5e9;
    border-left-color: #4caf50;
    color: #2e7d32;
}

/* Loading animation for form submission */
.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto;
}

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

/* Responsive design */
@media (max-width: 992px) {
    .login-card {
        flex-direction: column;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .brand-side, .form-side {
        padding: 40px 30px;
    }
    
    .brand-text h1 {
        font-size: 1.8rem;
    }
    
    .form-header h2 {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 15px;
    }
    
    .brand-side, .form-side {
        padding: 30px 20px;
    }
    
    .remember-forgot {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .circle-3 {
        display: none;
    }
}


/* =========================
   MOBILE OPTIMIZATION
========================= */

/* Prevent 100vh issues on mobile browsers */
body {
    min-height: 100svh;
}

@media (max-width: 400px) {

    .logo {
        width: 110px;
        height: 110px;
    }

    .brand-text p {
        font-size: 0.8rem;
    }

    .form-header h2 {
        font-size: 1.1rem;
    }
}
@media (max-width: 768px) {

    body {
        align-items: flex-start;
        padding-top: 20px;
    }

    .login-card {
        flex-direction: column;
        border-radius: 16px;
    }

    /* Hide branding fluff on small screens */
    .brand-side {
        padding: 25px 20px;
    }

    .features {
        display: none;
    }



    .brand-text p {
        font-size: 0.85rem;
        text-align: center;
    }

    /* Form spacing */
    .form-side {
        padding: 30px 20px;
    }

    .form-for-login {
        margin: 0;
    }

    .form-header h2 {
        font-size: 1.3rem;
    }

    .form-header p {
        font-size: 0.8rem;
    }

    /* Bigger tap targets */
    .form-control {
        padding: 14px 16px;
        font-size: 1rem;
    }

    .login-btn {
        padding: 14px;
        font-size: 1rem;
    }

    .password-toggle {
        right: 14px;
    }

    /* Stack remember + forgot */
    .remember-forgot {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .forgot-password {
        text-align: left;
    }

    /* Version tag not blocking content */
    .version {
        position: static;
        text-align: center;
        margin-top: 15px;
        font-size: 0.7rem;
    }

    /* Reduce heavy background blobs */
    .blob {
        filter: blur(80px);
        opacity: 0.35;
    }

    .blob-3 {
        display: none;
    }
}
@media (max-width: 768px) {

    body {
        background: var(--white);
        align-items: stretch;
        padding: 0;
    }

    .container {
        padding: 0;
        max-width: 100%;
    }

    .login-card {
        border-radius: 0;
        min-height: 100svh;
        box-shadow: none;
    }
}

@media (max-width: 768px) {

    .brand-side {
        padding: 24px 16px 18px;
        border-radius: 0 0 24px 24px;
    }

    .logo {
        width: 130px;
        height: 130px;
    }

    .brand-text p {
        font-size: 0.8rem;
        line-height: 1.4;
        max-width: 100%;
    }

    .features {
        display: none;
    }
}

@media (max-width: 768px) {

    .form-side {
        padding: 24px 16px;
        flex: 1;
    }

    .form-header {
        margin-bottom: 24px;
    }

    .form-header h2 {
        font-size: 1.25rem;
    }

    .form-header p {
        font-size: 0.8rem;
    }

    .form-for-login {
        margin: 0;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-control {
        padding: 9px 14px;
        font-size: 1rem;
        border-radius: 10px;
    }

    .password-toggle {
        right: 12px;
    }
}

@media (max-width: 768px) {

    .remember-forgot {
        flex-direction: row;
        justify-content: space-between;
        font-size: 0.8rem;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {

    .login-btn {
        font-size: 1rem;
        border-radius: 14px;
    }
}

@media (max-width: 768px) {

    .bg-decoration {
        display: none;
    }
}

@media (max-width: 768px) {

    .brand-text {
        display: none;
    }

}

@media (max-width: 768px) {

    .brand-side {
        padding: 16px 16px 12px;
        min-height: auto;
    }

    /* limit how tall the red area can get */
    .brand-side {
        max-height: 240px;
    }

    .logo-container {
        margin-bottom: 0;
    }

    /* already hiding text */
    .brand-text {
        display: none;
    }

    .features {
        display: none;
    }
}

@media (max-width: 768px) {

    .form-side {
        padding: 18px 16px 20px; /* less vertical padding */
    }

    .form-header {
        margin-bottom: 16px;
    }

    .form-header h2 {
        margin-bottom: 4px;
    }

    .form-group {
        margin-bottom: 14px; /* tighter inputs */
    }

    .remember-forgot {
        margin-bottom: 14px;
    }

    .login-btn {
        margin-top: 6px;
    }

}

@media (max-width: 768px) {

    .form-side {
        flex: 1;
        padding: 16px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start; 
        padding-top: 20%; 
        padding-left: 40px;
        padding-right: 40px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {

    html, body {
        height: 100%;
    }

    body {
        background: var(--light-gray);
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .container {
        height: auto;
        width: 100%;
        max-width: 560px;
        display: flex;
        flex-direction: column; /* 🔥 THIS IS THE FIX */
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    .login-card {
        width: 100%;
        max-width: 520px;
        height: auto;
        flex-direction: column;
        border-radius: 20px;
        box-shadow: var(--shadow);
    }

    /* Brand header */
    .brand-side {
        max-height: 200px;
        padding: 24px;
        border-radius: 20px 20px 0 0;
    }

    .logo {
        width: 110px;
        height: 110px;
    }

    /* Form spacing */
    .form-side {
        padding: 28px;
        justify-content: flex-start;
    }

    .form-header {
        margin-bottom: 22px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    /* Version under card */
    .version {
        position: static;
        margin-top: 10px;
        text-align: center;
        font-size: 0.75rem;
        width: 100%;
    }

    /* Clean tablet view */
    .features,
    .brand-text {
        display: none;
    }
}
