/* Modern Authentication Styles */
:root {
    --primary-color: #e60000;
    --primary-dark: #c40000;
    --primary-light: #ff3333;
    --secondary-color: #222222;
    --accent-color: #f5f5f5;
    --text-color: #333333;
    --text-light: #777777;
    --text-white: #ffffff;
    --bg-dark: #111111;
    --bg-light: #f9f9f9;
    --success-color: #28a745;
    --shadow-light: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.15);
    --shadow-dark: 0 10px 40px rgba(0, 0, 0, 0.2);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('../img/buy_now.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    margin: 0; /* Ensure no default body margin */
}

/* New layout container for form and info side-by-side */
.auth-layout {
    display: flex;
    justify-content: center;
    align-items: stretch; /* Stretch items to fill height */
    gap: 40px; /* Space between form and info */
    max-width: 1100px; /* Max width for the entire layout */
    width: 90%; /* Responsive width */
    margin: auto; /* Center the layout within the body */
    padding: 20px 0; /* Add some vertical padding */
}

.auth-container {
    max-width: 450px; /* Keep max-width for the form container */
    width: 100%; /* Allow it to shrink if needed */
    position: relative;
    display: flex; /* Use flex to manage child forms */
    height: 100%; /* Fill height of auth-layout */
}

.auth-form {
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    transform: translateY(0);
    transition: all 0.4s ease;
    position: absolute; /* Position absolutely to stack forms */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none; /* Disable interaction when not active */
    visibility: hidden; /* Hide when not active */
}

.auth-form.active {
    opacity: 1;
    pointer-events: auto; /* Enable interaction when active */
    visibility: visible;
    position: relative; /* Take up space when active */
}

.auth-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 2rem;
    position: relative;
    padding-bottom: 10px;
}

.auth-form h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--primary-color);
}

.auth-form a {
    text-decoration: none;
    color: #cc0000;
    transition: color 0.3s ease;
}

.auth-form a:hover {
    color: #990000;
}

.auth-form .mb-4 {
    color: #666; /* Apply color for paragraph in forgot form */
}

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

.form-control {
    height: 50px;
    padding-left: 45px;
    font-size: 1rem;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(204, 0, 0, 0.15);
    outline: none;
}

.form-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    transition: all 0.3s ease;
}

.form-control:focus + i {
    color: var(--primary-color);
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-dark), var(--primary-color));
    border: none;
    height: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: all 0.6s ease;
    z-index: 1; /* Ensure before pseudo-element is below text */
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(204, 0, 0, 0.3);
}

.btn-primary span {
    position: relative;
    z-index: 2; /* Ensure text is above pseudo-element */
}

.auth-links {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.auth-links a {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding: 0 5px; /* Add padding for better spacing around | */
}

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

.auth-links a:hover::after {
    width: 100%;
}

.form-feedback {
    display: flex;
    align-items: center;
    margin-top: -15px; /* Adjust margin to be closer to input */
    margin-bottom: 20px; /* Ensure space before next element */
    font-size: 0.9rem;
    color: var(--error-color);
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    height: 0; /* Occupy no space when hidden */
    overflow: hidden; /* Hide overflow */
}

.form-feedback.show {
    opacity: 1;
    transform: translateY(0);
    height: auto; /* Allow content to take up space */
}

.form-feedback i {
    margin-right: 5px;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    z-index: 2; /* Ensure toggle is above input for clickability */
}

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

.form-strength {
    height: 4px;
    background: #e1e1e1;
    margin-top: 5px;
    border-radius: 2px;
    overflow: hidden;
}

.strength-meter {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
}

.strength-meter.weak { width: 33%; background: var(--error-color); }
.strength-meter.medium { width: 66%; background: #ffc107; }
.strength-meter.strong { width: 100%; background: var(--success-color); }

/* Loading animation */
.loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    width: 20px; /* Smaller spinner */
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite; /* Faster spin */
}

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

/* Social login buttons */
.social-login {
    margin-top: 30px;
    text-align: center;
}

.social-login p {
    color: #666;
    margin-bottom: 15px;
    position: relative;
}

.social-login p::before,
.social-login p::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: #ddd;
}

.social-login p::before { left: 0; }
.social-login p::after { right: 0; }

.social-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e1e1e1;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.social-btn i {
    font-size: 1.2rem;
}

.social-btn.google i { color: #DB4437; }
.social-btn.facebook i { color: #4267B2; }
.social-btn.twitter i { color: #1DA1F2; }

/* New Auth Info styles */
.auth-info {
    flex: 1; /* Allows it to take up remaining space */
    min-width: 350px; /* Minimum width before wrapping */
    background: rgba(0, 0, 0, 0.5); /* Darker transparent background */
    color: var(--text-light);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
    border-left: 4px solid var(--primary-color); /* Match forms' left border */
    animation: pulse-subtle 2s infinite; /* Apply subtle pulse here */
}

@keyframes pulse-subtle {
    0% { border-color: rgba(204, 0, 0, 0.7); }
    50% { border-color: rgba(204, 0, 0, 1); }
    100% { border-color: rgba(204, 0, 0, 0.7); }
}

.auth-info h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: var(--text-light);
    font-weight: 700;
    line-height: 1.3;
}

.auth-info p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.auth-info img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .auth-layout {
        flex-direction: column; /* Stack elements vertically */
        gap: 30px; /* Adjust gap for stacking */
        max-width: 450px; /* Constrain width when stacked */
        width: 95%; /* Adjust width for smaller screens */
    }

    .auth-container,
    .auth-info {
        margin: 0 auto; /* Re-center elements when stacked */
        width: 100%; /* Ensure they take full available width within max-width */
    }
    .auth-form {
        position: relative; /* Make forms take up space when stacked */
        opacity: 1; /* Always visible when stacked */
        visibility: visible;
    }
    .auth-form:not(.active) {
        display: none; /* Hide inactive forms when stacked */
    }
}

@media (max-width: 768px) {
    .auth-info {
        display: none; /* Hide the info section on smaller mobile screens */
    }

    .auth-container {
        max-width: 400px; /* Slightly smaller max-width for forms on very small screens */
        width: 95%;
    }
    
    .auth-form {
        padding: 30px 20px;
    }
    
    .auth-form h2 {
        font-size: 1.75rem;
    }
}