@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --primary-red: #FF6B6B;
    --light-red: #FFB3B3;
    --dark-red: #E05D5D;
    --text-color: #333;
    --light-grey: #F5F5F5;
    --border-color: #DDD;
    --success-green: #28a745;
    --error-red: #dc3545;
}

/* --- Global & Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f2f5;
}

/* --- Main Container --- */
.container {
    display: flex;
    width: 900px;
    max-width: 95vw;
    /* Change min-height to a safe value and allow it to grow if needed */
    min-height: 650px; 
    height: auto; 
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden; /* Keep everything inside the rounded corners */
}
/* --- Left Panel --- */
.left-panel {
    width: 40%;
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    padding: 20px;
}

.left-panel::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="%23e05d5d" d="M0 0h100v100H0z"/><path fill="%23ffb3b3" d="M-10 50 L50 -10 L110 50 L50 110 Z"/><path fill="%23ff6b6b" d="M0 40 L40 0 L100 40 L60 100 Z"/></svg>') no-repeat center center / cover;
    opacity: 0.2;
    transform: rotate(45deg);
    z-index: 0;
    pointer-events: none;
}

.left-panel-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-button {
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid #fff;
    color: #fff;
    padding: 10px 30px;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    min-width: 150px;
}

.panel-button.active {
    background-color: #fff;
    color: var(--primary-red);
}

.panel-button:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.4);
}

/* --- Right Panel --- */
.right-panel {
    flex: 1.5;
    padding: 2rem; /* Reduced padding slightly to give more room */
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--light-grey);
    justify-content: center;
    min-height: 100%; /* Fill the container */
}
/* --- Logo --- */
.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #888;
}

.logo img {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

.logo-text {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--primary-red);
    letter-spacing: 2px;
}
.logo-text-forgotpassword {
    font-size: 2em;
    font-weight: 700;
    color: var(--primary-red);
    letter-spacing: 2px;
}

/* --- Form Sections --- */
/* Absolute positioning for desktop view stacking/switching */
.form-section {
    width: 100%;
    display: none; /* Hide by default */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
    opacity: 0;
}

.form-section.active {
    display: flex; /* Only show active section */
    opacity: 1;
}

/* --- Forms --- */
form {
    width: 100%;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Consistent spacing */
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 12px 40px 12px 40px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background-color: transparent;
    font-size: 1em;
    outline: none;
    color: var(--text-color);
}

.input-group-password input {
    width: 100%;
    padding: 12px 40px 12px ;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background-color: transparent;
    font-size: 1em;
    outline: none;
    color: var(--text-color);
}

.input-group input::placeholder {
    color: #aaa;
}

.input-group .icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 1.1em;
}

/* Password toggle */
.password-toggle-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    cursor: pointer;
    font-size: 1em;
}

.password-toggle-icon:hover {
    color: var(--text-color);
}

/* Forgot Password link */
.forgot-password {
    color: var(--primary-red);
    text-align: right;
    font-size: 0.9em;
    text-decoration: none;
    margin-top: -10px;
    margin-bottom: 10px;
}

/* Buttons */
.action-button, .btn-primary {
    display: block;
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 50px;
    background-color: var(--primary-red);
    color: #fff;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.action-button:hover, .btn-primary:hover {
    background-color: var(--dark-red);
}

/* Or login with */
.or-login-with {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #888;
    margin: 10px 0 20px;
}

.or-login-with .line {
    flex-grow: 1;
    height: 1px;
    background-color: var(--border-color);
}

/* Social buttons */
.social-login {
    display: flex;
    gap: 15px;
}

.social-button {
    background-color: #fff;
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    flex-grow: 1; /* Added for better mobile layout */
    justify-content: center; /* Added for better mobile layout */
}

.social-button.google { color: #4285F4; }
.social-button.facebook { color: #1877F2; }

.social-button:hover {
    background-color: var(--light-grey);
    border-color: #CCC;
}

/* Password Requirements */
.password-requirements {
    width: 100%;
    max-width: 350px;
    margin-top: -10px;
    padding: 10px 0;
    border-radius: 8px;
    font-size: 0.85em;
    color: #777;
}

.password-requirements .req-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.password-requirements .req-item i {
    margin-right: 8px;
    font-size: 0.9em;
    color: #aaa;
}

.password-requirements .req-item.valid i { color: var(--success-green); }
.password-requirements .req-item.invalid i { color: var(--error-red); }

/* --- Responsive --- */
@media (max-width: 900px) {
    body { padding: 20px; min-height: 100vh; }

    .container {
        flex-direction: column;
        width: 100%;
        height: auto;
        max-width: 450px;
        overflow: visible;
        min-height: 600px;
    }

    .left-panel, .right-panel { width: 100%; }
    
    .left-panel { padding: 40px 20px; justify-content: center; border-radius: 15px 15px 0 0; }
    .left-panel-content { flex-direction: row; gap: 15px; }
    .left-panel::before { display: none; }

    .right-panel { padding: 40px 30px; border-radius: 0 0 15px 15px; position: static; height: auto; }

    /* Key Fix for Mobile: On mobile, all sections are positioned statically */
    .form-section {
        position: static;
        height: auto;
        opacity: 1; /* Always visible to JS for switching */
        pointer-events: all;
        transition: none;
        display: none; /* JS will use display: block/flex to switch */
        padding: 0;
    }

    .form-section.active { display: flex; } /* Show only the active one */

    .logo { margin-bottom: 20px; }
    .logo img { width: 60px; height: 60px; }
    .logo-text { font-size: 2em; }

    .social-login { flex-direction: column; width: 100%; gap: 10px; }
    .social-button { width: 100%; justify-content: center; }

    .password-requirements { max-width: 100%; }
}




.input-group.error-border {
    border: 1px solid #ff4d4d !important;
}

/* The error text styling */
.error-message {
    color: #ff4d4d;
    font-size: 0.8rem;
    margin-top: 4px;
    margin-bottom: 8px; /* Space before the next input */
    text-align: left;
    display: none;
    
    /* CRITICAL FIXES: */
    width: 100%;
    max-width: 350px; /* Match your form width */
    word-wrap: break-word; /* Force wrap long text */
    overflow-wrap: break-word;
}
button:disabled {
    cursor: not-allowed;
    filter: grayscale(0.5);
    opacity: 0.7;
}

/* Optional: Subtle pulse effect during countdown */
.action-button:disabled {
    animation: pulse 2s infinite;
}
.req-item { color: #666; transition: color 0.3s; }
.req-item.valid { color: #2ecc71; } /* Green color for valid requirements */
.req-item.valid i { color: #2ecc71; }
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.98); }
    100% { transform: scale(1); }
}
.password-toggle-icon {
    cursor: pointer;
    position: absolute;
    right: 15px; /* Adjust based on your input padding */
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    transition: color 0.2s;
    z-index: 10;
}

.password-toggle-icon:hover {
    color: #333;
}

/* Ensure the input group is relative so the icon can be positioned inside */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

/* Give the input enough padding-right so the text doesn't go under the icon */
.input-group input {
    padding-right: 40px;
}

.error-message {
    margin-left: 0; 
}

.input-group.error-border {
    border: 1px solid #ff4d4d !important;
}

#password-requirements {
    width: 100%;
    max-width: 350px;
    max-height: 0; /* Hidden state */
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out; /* Smooth slide down */
    margin-top: 0;
}
/* 2. Show them when the input is focused (clicked or tabbed into) */
#signup-password-input:focus ~ #password-requirements,
#password-requirements.visible {
    max-height: 150px; /* Large enough for the 3 lines */
    opacity: 1;
    margin-top: 10px;
    margin-bottom: 10px;
}

.req-item {
    font-size: 0.8rem;
    margin: 5px 0;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
}

.req-item i {
    font-size: 0.9rem;
}

.input-error {
    border: 2px solid #e74c3c !important;
    background-color: #fdf2f2; /* Light red tint */
}
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #2ecc71;
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    animation: fadeInUp 0.5s;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
