/* --- Global Styles & Variables --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4A43EC;
    --primary-hover: #3a34c2;
    --bg-color: #F7F7F7;
    --card-bg: rgba(255, 255, 255, 0.1);
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #E0E0E0;
    --error-color: #D32F2F;
    --success-color: #388E3C;
    --font-family: 'Poppins', sans-serif;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(to right, #010534, #00010f) !important;
    margin: 0;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    backdrop-filter: blur(10px);
}

/* --- Main Auth Container --- */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    width: 100%;
    backdrop-filter: blur(5px);
}

.auth-card {
    display: flex;
    width: 100%;
    max-width: 1000px;
    background-color: whitesmoke;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- Responsive Design --- */
@media (max-width: 480px) { /* mobile-s */
    .auth-card { max-width: 90%; }
    .form-section { padding: 1rem; }
    .input-group input { font-size: 0.9rem; padding: 10px; }
    .auth-btn { font-size: 1rem; padding: 12px; }
}

@media (min-width: 481px) and (max-width: 767px) { /* mobile-l */
    .auth-card { max-width: 95%; }
    .form-section { padding: 1.5rem; }
}

@media (min-width: 768px) and (max-width: 991px) { /* tablet */
    .auth-card { max-width: 800px; }
    .image-section img { margin-top: 40%; }
}

@media (min-width: 992px) and (max-width: 1199px) { /* laptop-s */
    .auth-card { max-width: 900px; }
}

@media (min-width: 1200px) { /* laptop-l */
    .auth-card { max-width: 1000px; }
    .image-section img { margin-top: 55%; }
}

.form-section {
    flex-basis: 50%;
    padding: 3rem 4rem;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.05);
}

.image-section {
    flex-basis: 45%;
    overflow: hidden;
}

.image-section img {
    width: 100%;
    height: 60%;
    margin-top: 55%;
    margin-left: -5%;
    object-fit: cover;
    opacity: 0.9;
}

.logo, .brand-title { display: inline-block; vertical-align: middle; }
.logo { width: 48px; height: 48px; }
.brand-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0 10px;
    color: var(--text-color-light);
}
.brand-title .c-red { color: #e81d0b; }
.brand-title .c-blue { color: #0e67f5; }
.brand-title .c-yellow { color: #FBBC05; }
.brand-title .c-green { color: #035e0a; }

/* --- Header & Form Elements --- */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header .logo {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
}

.auth-header .title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.auth-header .subtitle {
    font-size: 1rem;
    color: var(--text-light);
    margin: 0;
}

.input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: rgba(255, 255, 255, 0.2);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 67, 236, 0.2);
}

.input-group input::placeholder {
    color: #AAAAAA;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 40px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toggle-password svg {
    transition: fill 0.3s ease;
}

.toggle-password[data-visible="true"] {
    transform: rotate(180deg);
    opacity: 0.7;
}

.toggle-password[data-visible="false"] {
    transform: rotate(0deg);
    opacity: 1;
}

.toggle-password:hover svg {
    fill: var(--primary-color);
}

.error-message {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    height: 1em;
    opacity: 0;
    transition: opacity 0.3s;
}
.error-message.show {
    opacity: 1;
}

/* --- Social Auth & Separator --- */
.social-auth {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.social-btn {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.2);
}
.social-btn:hover {
    background-color: #f5f5f5;
    border-color: #c0c0c0;
}
.social-btn img {
    width: 20px;
    margin-right: 10px;
}

.separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.separator::before, .separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}
.separator span {
    padding: 0 1rem;
}

/* --- Buttons & Links --- */
.auth-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}
.auth-btn:hover:not(:disabled) {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 15px rgba(74, 67, 236, 0.3);
}
.auth-btn:disabled {
    background-color: #b3b0f5;
    cursor: not-allowed;
}

.auth-switch {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-light);
}
.auth-switch a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.remember-me {
    display: flex;
    align-items: center;
}
.remember-me input {
    margin-right: 8px;
}
.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
}

.terms-popup-trigger {
    margin-top: 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}
.terms-popup-trigger input { margin-right: 8px; }
.terms-popup-trigger a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.terms-popup-trigger a:hover {
    text-decoration: underline;
}

/* --- Popup Styles --- */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

.close-btn:hover {
    color: var(--primary-color);
}

@media (max-width: 900px) {
    .image-section {
        display: none;
    }
    .form-section {
        flex-basis: 100%;
        padding: 2rem;
    }
    .input-group{
       max-width: 800px;
    }
}

@media (max-width: 500px) {
    .auth-container {
        padding: 1rem;
    }
    .form-section {
        padding: 1.5rem;
    }
    .social-auth {
        flex-direction: column;
    }
    .popup-content { padding: 15px; }
    .input-group{
       max-width: 400px;
    }
}