/*
  ==================================
  Modern Login Page CSS for CityZen
  ==================================
  - Author: Gemini
  - Date: October 8, 2025
  - Description: A clean, responsive, and animated login form style.
*/

/* ========= GLOBAL RESET & FONT ========= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", "Inter", Arial, sans-serif;
}

/* ========= BODY & LAYOUT ========= */
body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f0f7ff, #e6f2ff);
    overflow: hidden; /* Prevents scrollbars from background shapes */
    position: relative;
    padding: 20px;
}

/* ========= DECORATIVE BACKGROUND SHAPES ========= */
.bg-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    filter: blur(80px); /* Creates the soft, diffused look */
    z-index: 0;
    animation: float 10s ease-in-out infinite alternate;
}

.shape1 {
    width: 380px;
    height: 380px;
    background: #170b85;
    top: -120px;
    left: -150px;
}

.shape2 {
    width: 300px;
    height: 300px;
    background: #00aaff;
    bottom: -100px;
    right: -120px;
    animation-delay: 2s; /* Stagger the animation */
}

/* ========= HOME BUTTON ========= */
.home-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, #170b85, #007bff);
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    animation: fadeInDown 0.8s ease forwards;
}

.home-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.4);
}

.home-icon {
    font-size: 1.2rem;
}

/* ========= MAIN LOGIN CONTAINER ========= */
.container {
    display: flex;
    width: 900px;
    max-width: 100%;
    min-height: 550px; /* EDIT: Use min-height to allow container to grow */
    height: auto;       /* EDIT: Allow height to fit content */
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    z-index: 1;
    animation: scaleIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ========= LEFT SIDE (FORM) ========= */
.left {
    width: 48%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
    animation: slideInLeft 1s ease forwards;
}

.left h2 {
    font-size: 2rem;
    color: #170b85;
    margin-bottom: 25px;
    font-weight: 700;
    min-height: 60px; /* Ensures space for wrapping text on smaller screens */
    word-break: break-word; /* ADDED: Prevents long words from breaking layout */
}

/* This is the fix for the "(User)" span */
.left h2 span {
    color: #555;
    font-size: 1.2rem;
    font-weight: 500;
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
}

/* FORM INPUTS */
.input-group {
    margin-bottom: 20px;
    position: relative;
    min-height: 95px; /* MODIFIED: Stabilizes form layout for long labels */
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
    word-break: break-word; /* ADDED: Allows long labels to wrap correctly */
}

.input-group input {
    width: 100%;
    padding: 14px;
    border: 1.5px solid #dcdcdc;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.input-group input:focus {
    border-color: #170b85;
    box-shadow: 0 0 10px rgba(23, 11, 133, 0.15);
    outline: none;
    background: #fff;
}

/* CHECKBOX */
.checkbox {
    display: flex;
    align-items: center;
    margin: 15px 0 25px;
    font-size: 0.9rem;
    color: #444;
}

.checkbox label {
    word-break: break-word; /* ADDED: Ensures "Remember me" text wraps */
}

.checkbox input {
    margin-right: 10px;
    accent-color: #170b85;
    width: 16px;
    height: 16px;
    flex-shrink: 0; /* Prevents checkbox from shrinking */
}

/* BUTTONS */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    border: none;
    background: linear-gradient(135deg, #170b85, #007bff);
    color: #fff;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 123, 255, 0.25);
}

/* SIGNUP LINK */
.signup {
    text-align: center;
    font-size: 0.9rem;
    color: #555;
    min-height: 3em; 
    display: block; /* MODIFIED: Changed from flex to block for natural text wrapping */
    word-break: break-word; /* ADDED: Ensures this text block wraps properly */
}

.signup a {
    color: #007bff;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    margin-left: 5px; /* Adds a little space before the link */
}

.signup a::after {
    content: "";
    width: 0%;
    height: 2px;
    position: absolute;
    bottom: -3px;
    left: 0;
    background: #170b85;
    transition: width 0.3s ease;
}

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

/* ========= RIGHT SIDE (IMAGE) ========= */
.right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: slideInRight 1s ease forwards;
}

.right img {
    max-width: 80%;
    height: auto;
    animation: float 8s ease-in-out infinite;
}

/* ========= ANIMATIONS ========= */
@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0); }
}

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

@keyframes scaleIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@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); }
}

/* ========= RESPONSIVENESS ========= */

/* Tablets (<= 992px) */
@media (max-width: 992px) {
    .container {
        flex-direction: column;
        width: 100%;
        max-width: 500px;
        height: auto;
    }

    .left, .right {
        width: 100%;
    }

    .right {
        order: -1; /* Image appears first on smaller screens */
        padding: 20px 0;
        min-height: 250px;
    }
    
    .right img {
        max-width: 50%;
    }

    .left {
        padding: 30px;
    }
}

/* Mobile (<= 576px) */
@media (max-width: 576px) {
    body {
        padding: 15px;
        align-items: flex-start;
        padding-top: 80px;
    }

    .container {
        padding: 0;
    }

    .home-btn {
        top: 15px;
        left: 15px;
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .left {
        padding: 25px;
    }
    
    .left h2 {
        font-size: 1.6rem;
        text-align: center;
    }

    .left h2 span {
        font-size: 1rem;
        display: block; /* Stack span below h2 on mobile */
        margin-left: 0;
        margin-top: 5px;
    }

    .right {
        min-height: 200px;
    }

    .right img {
        max-width: 55%;
    }

    .btn, .input-group input {
        padding: 12px;
        font-size: 0.95rem;
    }
}

