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

* { margin: 0; padding: 0; box-sizing: border-box; }

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

/* ══════ BACKGROUND ══════ */
.auth-wrapper {
    width: 100%; height: 100vh;
    display: flex; justify-content: center; align-items: center;
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 50%, #dbeafe 100%);
}

.bg-blur {
    position: absolute; border-radius: 50%;
    filter: blur(120px); opacity: 0.3;
}

.blur-1 {
    width: 400px; height: 400px;
    background: #93c5fd;
    top: -120px; left: -120px;
}

.blur-2 {
    width: 450px; height: 450px;
    background: #a5b4fc;
    bottom: -150px; right: -150px;
}

/* ══════ FLOATING ICONS ══════ */
.floating-icons {
    position: fixed; inset: 0; z-index: 0;
    pointer-events: none;
}

.float-icon {
    position: absolute;
    font-size: 2rem;
    animation: float 6s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
    opacity: 0.4;
}

/* ══════ TOP LOGO ══════ */
.top-logo {
    position: fixed; top: 1.5rem; left: 2rem;
    z-index: 200; display: flex; align-items: center;
    text-decoration: none;
    background: none;
    padding: 8px;
    border-radius: 0;
    border: none;
    transition: all 0.3s;
}

.top-logo:hover {
    transform: translateY(-2px);
}

.top-logo img { height: 80px; width: auto; }

/* ══════ MAIN CONTAINER ══════ */
.container {
    position: relative;
    width: 1000px;
    max-width: 95%;
    min-height: 620px;
    overflow: hidden;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow:
        0 20px 60px rgba(0,0,0,0.08),
        0 4px 16px rgba(0,0,0,0.04);
}

/* ══════ FORM SECTION ══════ */
.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.6s ease-in-out;
    background: #ffffff;
}

.form-container form {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 50px;
    color: #1e293b;
}

.form-container form h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #0f172a;
}

.form-container form .form-subtitle {
    margin-bottom: 20px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 400;
}

/* ══════ LOGO IN SIGN-IN ══════ */
.card-logo-inline { margin-bottom: 16px; }

.card-logo-inline img {
    width: 70px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
    transition: transform 0.3s;
}

.card-logo-inline:hover img { transform: scale(1.05); }

/* ══════ INPUTS ══════ */
.form-container input,
.form-container select {
    width: 100%;
    padding: 13px 16px;
    margin: 6px 0;
    border: 1.5px solid #e2e8f0;
    outline: none;
    border-radius: 12px;
    background: #f8fafc;
    color: #1e293b;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    transition: 0.3s;
}

.form-container input:focus,
.form-container select:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

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

.form-container select {
    appearance: none;
    cursor: pointer;
    color: #64748b;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.form-container select option {
    background: #ffffff;
    color: #1e293b;
}

.row {
    display: flex;
    gap: 10px;
}

.row input,
.row select {
    flex: 1;
    min-width: 0;
}

/* ══════ SECTION LABELS ══════ */
.section-label {
    color: #3b82f6;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 10px 0 2px;
    display: flex; align-items: center; gap: 6px;
}

.section-label i { font-size: 10px; }

/* ══════ PASSWORD TOGGLE ══════ */
.pw-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.pw-wrap input {
    width: 100%;
    padding-right: 40px;
}

.pw-eye {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    cursor: pointer; padding: 4px;
    color: #94a3b8;
    font-size: 13px;
    transition: color 0.2s;
}

.pw-eye:hover { color: #3b82f6; }

/* ══════ FORM EXTRAS ══════ */
.form-extras {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 2px 0 8px;
}

.forgot-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    transition: color 0.2s;
}

.forgot-link:hover { color: #2563eb; }

/* ══════ BUTTONS ══════ */
.btn-auth {
    margin-top: 14px;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37,99,235,0.35);
}

.btn-auth:active { transform: translateY(0); }

.btn-ghost {
    margin-top: 16px;
    padding: 12px 36px;
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 12px;
    background: transparent;
    color: white;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: 0.3s;
}

.btn-ghost:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.15);
    border-color: white;
    box-shadow: 0 8px 20px rgba(255,255,255,0.1);
}

/* ══════ ALT LOGIN ══════ */
.alt-login-divider {
    display: flex; align-items: center;
    gap: 12px; margin: 10px 0 8px;
    color: #cbd5e1;
    font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
}

.alt-login-divider::before,
.alt-login-divider::after {
    content: ''; flex: 1; height: 1px;
    background: #e2e8f0;
}

.btn-alt-login {
    width: 100%; padding: 11px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    color: #475569;
    font-size: 13px; font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer; transition: 0.3s;
    display: flex; align-items: center;
    justify-content: center; gap: 8px;
    text-decoration: none;
}

.btn-alt-login:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
    transform: translateY(-1px);
}

.back-home {
    margin-top: 8px; text-align: center;
}

.back-home a {
    color: #94a3b8;
    font-size: 12px; text-decoration: none;
    transition: color 0.2s;
}

.back-home a:hover { color: #3b82f6; }

/* ══════ FLASH MESSAGES ══════ */
.flash {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    animation: flashIn 0.3s ease;
}

.flash-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.flash-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.flash-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }

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

/* ══════ SIGN IN ══════ */
.sign-in-container {
    left: 0; width: 50%; z-index: 2;
}

.sign-in-container form {
    height: auto;
    gap: 0;
}

.container.right-panel-active .sign-in-container {
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
}

/* ══════ SIGN UP ══════ */
.sign-up-container {
    left: 0; width: 50%;
    opacity: 0; z-index: 1;
    visibility: hidden;
}

.container.right-panel-active .sign-up-container {
    transform: translateX(100%);
    opacity: 1; z-index: 5;
    visibility: visible;
    animation: showSignup 0.6s;
}

@keyframes showSignup {
    0%, 49.99% { opacity: 0; z-index: 1; visibility: hidden; }
    50%, 100% { opacity: 1; z-index: 5; visibility: visible; }
}

/* ══════ OVERLAY CONTAINER ══════ */
.overlay-container {
    position: absolute;
    top: 0; left: 50%;
    width: 50%; height: 100%;
    overflow: hidden;
    transition: transform 0.6s ease-in-out;
    z-index: 100;
    border-radius: 0 24px 24px 0;
}

.container.right-panel-active .overlay-container {
    transform: translateX(-100%);
    border-radius: 24px 0 0 24px;
}

.overlay {
    position: relative;
    left: -100%;
    width: 200%; height: 100%;
    background: linear-gradient(135deg, #1d4ed8, #2563eb 40%, #3b82f6 70%, #1e40af);
    color: white;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.container.right-panel-active .overlay {
    transform: translateX(50%);
}

/* ══════ OVERLAY PANELS ══════ */
.overlay-panel {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    width: 50%; height: 100%;
    padding: 0;
}

.overlay-left {
    transform: translateX(-20%);
}

.container.right-panel-active .overlay-left {
    transform: translateX(0);
}

.overlay-right {
    right: 0;
}

.container.right-panel-active .overlay-right {
    transform: translateX(20%);
}

.overlay-panel h1 {
    font-size: 30px;
    font-weight: 700;
    margin-top: 16px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.overlay-panel p {
    margin: 14px 0;
    opacity: 0.85;
    line-height: 1.7;
    font-size: 13px;
    max-width: 280px;
}

.overlay-image {
    width: 220px;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 12px 24px rgba(0,0,0,0.2));
}

/* Brand image in overlay — white card background for visibility */
.overlay-brand {
    width: 260px;
    max-width: 90%;
    background: #ffffff;
    border-radius: 20px;
    padding: 20px 24px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    animation: float 4s ease-in-out infinite;
    object-fit: contain;
}

/* Stacked boxes in right overlay */
.overlay-stacked {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    align-items: center;
}

.overlay-box {
    width: 100%;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.overlay-box-img {
    width: 100%;
    height: 45%;
    padding: 0;
}

.overlay-hero-img {
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    animation: none;
    object-fit: cover;
}

.overlay-box-img .overlay-brand {
    margin: 0;
}

.overlay-box-text {
    padding: 20px 40px 40px 40px;
    max-width: 360px;
    margin: auto;
}

.overlay-box-text h1 {
    margin-top: 0;
    font-size: 24px;
}

.overlay-box-text p {
    margin: 10px 0;
    font-size: 12px;
}

.overlay-features { margin: 8px 0; }

.o-feat {
    display: flex; align-items: center;
    gap: 8px; justify-content: center;
    color: rgba(255,255,255,0.8);
    font-size: 12px; font-weight: 500;
    margin-bottom: 5px;
}

.o-feat i { color: #86efac; font-size: 11px; }

/* ══════ SCROLL FOR SIGNUP ══════ */
.form-scroll {
    max-height: 380px;
    overflow-y: auto;
    padding-right: 6px;
    margin-bottom: 4px;
}

.form-scroll::-webkit-scrollbar { width: 3px; }
.form-scroll::-webkit-scrollbar-track { background: transparent; }
.form-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* ══════ FLOAT ANIMATION ══════ */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

/* ══════ MOBILE TOGGLE ══════ */
.mobile-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem; left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 100px;
    padding: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.mobile-tab {
    padding: 10px 24px;
    background: transparent;
    border: none; border-radius: 100px;
    color: #64748b;
    font-size: 13px; font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer; transition: 0.3s;
}

.mobile-tab.active {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

/* ══════ RESPONSIVE ══════ */
@media (max-width: 900px) {
    .container {
        width: 95%;
        min-height: auto;
        border-radius: 20px;
    }

    .overlay-container { display: none; }

    .form-container {
        position: relative;
        width: 100% !important;
        left: 0 !important;
        transform: none !important;
    }

    .sign-in-container { display: block; opacity: 1; }
    .sign-up-container { display: none; opacity: 1; }

    .container.right-panel-active .sign-in-container {
        display: none; transform: none;
    }

    .container.right-panel-active .sign-up-container {
        display: block; opacity: 1;
        transform: none;
        animation: mobileSlide 0.4s ease;
    }

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

    .mobile-toggle { display: flex; }
    .row { flex-direction: column; gap: 0; }
    .form-container form { padding: 36px 28px; }
    .form-scroll { max-height: none; overflow-y: visible; }
    .float-icon { display: none; }
    .top-logo { display: none; }
    .auth-wrapper { align-items: flex-start; padding-top: 2rem; }
}

@media (max-width: 480px) {
    .form-container form { padding: 28px 20px; }
    .form-container form h1 { font-size: 24px; }
    .auth-wrapper { padding: 1rem; }
}
