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

:root {
    --primary: #059669; /* Rich Emerald / Mint Green */
    --primary-hover: #047857;
    --primary-light: #dcfce7;
    --secondary: #f59e0b; /* Warm Amber */
    --accent: #8b5cf6; /* Soft Purple for AI */
    --surface: rgba(255, 255, 255, 0.85); /* Glass surface */
    --text-main: #0f172a;
    --text-muted: #475569;
    --error: #dc2626;
    --success: #059669;
    --border: rgba(255, 255, 255, 0.6);
    
    --font-sans: "Be Vietnam Pro", sans-serif;
}

body {
    font-family: var(--font-sans);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: linear-gradient(135deg, #e6fcf5 0%, #ebfbee 50%, #dcfce7 100%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

button,
input,
textarea,
select {
    font-family: var(--font-sans);
}

/* Split Layout Wrapper */
.auth-page-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

/* Background Animated Blobs for Extra WOW effect */
.auth-page-wrapper::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(255,255,255,0) 70%);
    top: -150px;
    left: -150px;
    z-index: 0;
    pointer-events: none;
}

.auth-page-wrapper::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.12) 0%, rgba(255,255,255,0) 70%);
    bottom: -200px;
    right: -100px;
    z-index: 0;
    pointer-events: none;
}

/* Left side: Banner / Animation */
.auth-banner {
    width: 50%;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    position: relative;
    align-self: flex-start;
    box-sizing: border-box;
    z-index: 1;
}

/* Floating Capybara Image */
.banner-image-container {
    position: relative;
    top: 40px;
    margin-bottom: 2rem;
    animation: floatAnim 4s ease-in-out infinite;
}

.banner-image {
    max-width: 340px;
    height: auto;
    filter: drop-shadow(0 20px 30px rgba(5, 150, 105, 0.25));
    border-radius: 2rem;
}

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

/* Banner Text Content */
.banner-content {
    position: relative;
    top: 40px;
    text-align: center;
    max-width: 480px;
    padding: 0 1rem;
}

.banner-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 1rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.banner-title .banner-title-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(-18px);
    filter: blur(10px);
    animation: bannerTitleFadeDown 460ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: opacity, transform, filter;
}

.banner-title .banner-title-char.space {
    width: 0.32em;
}

@keyframes bannerTitleFadeDown {
    from {
        opacity: 0;
        transform: translateY(-18px);
        filter: blur(10px);
    }
    58% {
        opacity: 1;
        filter: blur(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.banner-subtitle {
    color: #475569;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.6;

}

/* Right side: Form Content */
.auth-content {
    width: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* FadeUpIn Animation for Form Container */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes authFormSlideInRight {
    from {
        opacity: 0;
        transform: translateX(56px);
        filter: blur(8px);
    }
    24% {
        opacity: 1;
        filter: blur(0);
    }
    to {
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
    }
}

@keyframes loginCardDepthPop {
    from {
        opacity: 0;
        transform: translateZ(-90px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateZ(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .banner-title .banner-title-char {
        opacity: 1;
        transform: none;
        filter: none;
        animation: none;
    }

    .auth-form-container {
        opacity: 1;
        transform: none;
        filter: none;
        animation: none;
    }

}

/* Premium Glassmorphism Form Container */
.auth-form-container {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.02);
    
    animation: authFormSlideInRight 1250ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both;
    will-change: opacity, transform, filter;
}

.login-auth-page .auth-content,
.register-auth-page .auth-content {
    perspective: 1200px;
    perspective-origin: center;
}

.login-auth-page .auth-form-container,
.register-auth-page .auth-form-container {
    transform-style: preserve-3d;
    transform-origin: center center;
    backface-visibility: hidden;
    animation: loginCardDepthPop 380ms ease-out 35ms both;
    will-change: opacity, transform;
}

@media (prefers-reduced-motion: reduce) {
    .login-auth-page .auth-form-container,
    .register-auth-page .auth-form-container {
        opacity: 1;
        transform: none;
        filter: none;
        animation: none;
    }
}

.auth-header {
    margin-bottom: 2rem;
    text-align: left;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

.auth-header p {
    color: #475569;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 0.75rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: #0f172a;
    box-sizing: border-box;
    transition: all 0.2s ease;
    background-color: rgba(255, 255, 255, 0.9);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12);
}

.form-control::placeholder {
    color: #94a3b8;
}

.remembered-email-wrapper {
    position: relative;
}

.remembered-email-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.4rem);
    z-index: 30;
    display: none;
    overflow: hidden;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 0.75rem;
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.remembered-email-menu.show {
    display: block;
}

.remembered-email-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: none;
    background: #ffffff;
}

.remembered-email-item:hover {
    background: #ecfdf5;
}

.remembered-email-value {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 0 0.85rem 1rem;
    border: none;
    background: transparent;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.remembered-email-item:hover .remembered-email-value {
    color: var(--primary);
}

.remembered-email-remove {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: 0.65rem;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #94a3b8;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.remembered-email-remove:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Password Visibility Wrapper */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-control {
    padding-right: 2.75rem; /* Để không bị chữ đè lên nút con mắt */
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    height: 24px;
    width: 24px;
}

.password-toggle-btn svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

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

/* Form Options (Remember me & Forgot Password) */
.form-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;
    gap: 0.4rem;
    cursor: pointer;
    color: #334155;
    font-weight: 500;
}

.remember-me input[type="checkbox"] {
    accent-color: var(--primary);
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    border-radius: 0.25rem;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 1rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.25);
}

.btn-primary:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.15);
    background-color: #065f46;
}

/* Social Login Divider & Google Button */
.social-login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
}

.social-login-divider::before,
.social-login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #cbd5e1;
}

.social-login-divider span {
    padding: 0 0.75rem;
}

.btn-google {
    background-color: #ffffff;
    color: #334155;
    border: 1.5px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

.btn-google:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.btn-google:active {
    transform: translateY(1px) scale(0.98);
    background-color: #f1f5f9;
    box-shadow: none;
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error {
    background-color: #fef2f2;
    color: var(--error);
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #ecfdf5;
    color: var(--success);
    border: 1px solid #a7f3d0;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(203, 213, 225, 0.6);
    padding-top: 1.5rem;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Floating Favicon Home Link */
.auth-home-btn {
    position: absolute;
    top: 2rem;
    left: 2.5rem;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.12);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-home-btn img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.auth-home-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(5, 150, 105, 0.2);
    background: #ffffff;
}

.auth-home-btn:hover img {
    transform: scale(1.15) rotate(-8deg);
}

/* Responsive Design */
@media (max-width: 992px) {
    .auth-banner {
        display: none; /* Hide banner on smaller screens */
    }
    .auth-content {
        width: 100%;
        padding: 2rem 1.25rem;
    }
    .auth-form-container {
        max-width: 420px;
        padding: 2rem;
    }
    .auth-home-btn {
        top: 1rem;
        left: 1rem;
        width: 44px;
        height: 44px;
    }
    .auth-home-btn img {
        width: 26px;
        height: 26px;
    }
}
