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

/* Unified Color Variables - Black & Indigo Theme */
:root {
    --bg-primary: #000000;
    --bg-secondary: #0f0f0f;
    --bg-card: #1a1a1a;
    --accent-primary: #6366f1;
    --accent-secondary: #4f46e5;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: rgba(99, 102, 241, 0.4);
    --glow-color: rgba(99, 102, 241, 0.5);
}

/* Authentication Wrapper - Premium Black Theme with Glow */
.auth-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--bg-primary);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
    z-index: 1000;
    padding: 40px 20px 25px 20px;
}

/* Premium Container Box with Glow Effect */
.auth-box {
    position: relative;
    width: 1100px;
    max-width: 95vw;
    min-height: 550px;
    height: auto;
    max-height: 72vh;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 32px;
    box-shadow:
        0 0 60px rgba(99, 102, 241, 0.3),
        0 20px 80px rgba(0, 0, 0, 0.8),
        inset 0 0 80px rgba(99, 102, 241, 0.03);
    display: flex;
    overflow: visible;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: boxGlow 3s ease-in-out infinite;
}

@keyframes boxGlow {

    0%,
    100% {
        box-shadow:
            0 0 60px rgba(99, 102, 241, 0.3),
            0 20px 80px rgba(0, 0, 0, 0.8),
            inset 0 0 80px rgba(99, 102, 241, 0.03);
    }

    50% {
        box-shadow:
            0 0 100px rgba(99, 102, 241, 0.5),
            0 20px 80px rgba(0, 0, 0, 0.8),
            inset 0 0 100px rgba(99, 102, 241, 0.05);
    }
}

/* Animated Background Diagonal Sweep */
.auth-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(135deg,
            transparent 0%,
            transparent 48%,
            rgba(99, 102, 241, 0.15) 48%,
            rgba(99, 102, 241, 0.15) 52%,
            transparent 52%,
            transparent 100%);
    animation: sweepAnimation 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes sweepAnimation {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(50%);
    }
}

/* Credentials Panel - Left Side */
.credentials-panel {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    padding: 30px 60px;
    /* Reduced vertical padding */
    z-index: 2;
    transition: all 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.credentials-panel.signin {
    left: 0;
}

.credentials-panel.signup {
    right: 0;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

/* Slide Elements Animation */
.slide-element {
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* Sign In Panel - Entry Animation */
.credentials-panel.signin .slide-element {
    animation: slideInLeft 0.8s ease-out forwards;
}

.credentials-panel.signin .slide-element:nth-child(1) {
    animation-delay: 0.1s;
}

.credentials-panel.signin .slide-element:nth-child(2) {
    animation-delay: 0.2s;
}

.credentials-panel.signin .slide-element:nth-child(3) {
    animation-delay: 0.3s;
}

.credentials-panel.signin .slide-element:nth-child(4) {
    animation-delay: 0.4s;
}

.credentials-panel.signin .slide-element:nth-child(5) {
    animation-delay: 0.5s;
}

.credentials-panel.signin .slide-element:nth-child(6) {
    animation-delay: 0.6s;
}

.credentials-panel.signin .slide-element:nth-child(7) {
    animation-delay: 0.7s;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Toggle State - Sign In Exit */
.auth-wrapper.toggled .credentials-panel.signin {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.auth-wrapper.toggled .credentials-panel.signin .slide-element {
    transform: translateX(-100px);
    opacity: 0;
}

/* Toggle State - Sign Up Entry */
.auth-wrapper.toggled .credentials-panel.signup {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.auth-wrapper.toggled .credentials-panel.signup .slide-element {
    animation: slideInRight 0.8s ease-out forwards;
}

.auth-wrapper.toggled .credentials-panel.signup .slide-element:nth-child(1) {
    animation-delay: 0.3s;
}

.auth-wrapper.toggled .credentials-panel.signup .slide-element:nth-child(2) {
    animation-delay: 0.4s;
}

.auth-wrapper.toggled .credentials-panel.signup .slide-element:nth-child(3) {
    animation-delay: 0.5s;
}

.auth-wrapper.toggled .credentials-panel.signup .slide-element:nth-child(4) {
    animation-delay: 0.6s;
}

.auth-wrapper.toggled .credentials-panel.signup .slide-element:nth-child(5) {
    animation-delay: 0.7s;
}

.auth-wrapper.toggled .credentials-panel.signup .slide-element:nth-child(6) {
    animation-delay: 0.8s;
}

.auth-wrapper.toggled .credentials-panel.signup .slide-element:nth-child(7) {
    animation-delay: 0.9s;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Typography */
.credentials-panel h2 {
    font-size: 32px;
    /* Slightly smaller */
    text-align: center;
    margin-bottom: 20px;
    /* Reduced margin */
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

/* Google Button - White Pill Style */
.google-btn {
    width: 100%;
    height: 48px;
    background: #ffffff;
    border-radius: 50px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 15px;
    /* Reduced margin */
    font-family: 'Poppins', sans-serif;
    color: #3c4043;
    position: relative;
    overflow: hidden;
    border: 1px solid #dadce0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-transform: none;
    letter-spacing: 0;
}

.google-btn::before {
    display: none;
}

.google-btn:hover::before {
    display: none;
}

.google-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.google-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s;
}

.google-btn:hover svg {
    transform: scale(1.05);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 15px 0;
    /* Reduced margin */
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
}

.divider span {
    padding: 0 20px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Field Wrapper - Input Fields */
.field-wrapper {
    position: relative;
    width: 100%;
    height: 52px;
    /* Slightly shorter */
    margin-top: 15px;
    /* Reduced margin */
}

.field-wrapper input {
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 0 50px 0 20px;
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.4s;
    font-family: 'Poppins', sans-serif;
}

.field-wrapper input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    background: var(--bg-card);
}

.field-wrapper input::placeholder {
    color: transparent;
}

.field-wrapper label {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    font-size: 15px;
    color: var(--text-secondary);
    transition: all 0.3s;
    pointer-events: none;
    background: transparent;
    padding: 0 8px;
    font-weight: 500;
}

.field-wrapper input:focus~label,
.field-wrapper input:valid~label {
    top: -2px;
    left: 16px;
    font-size: 12px;
    color: var(--accent-primary);
    background: var(--bg-card);
    padding: 0 8px;
}

.field-wrapper i {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.field-wrapper input:focus~i {
    color: var(--accent-primary);
    transform: translateY(-50%) scale(1.2);
}

/* Submit Button - Premium Gradient */
.submit-button {
    width: 100%;
    height: 55px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 16px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 700;
    border: none;
    font-family: 'Poppins', sans-serif;
    color: white;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
    /* Reduced margin */
    position: relative;
    overflow: hidden;
}

.submit-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.submit-button:hover::before {
    left: 100%;
}

.submit-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.6);
}

.submit-button:active {
    transform: translateY(-1px);
}

/* Switch Link */
.switch-link {
    font-size: 14px;
    /* Reduced size */
    text-align: center;
    margin: 15px 0 0 0;
    /* Reduced margin */
    color: #e0e0e0;
    font-weight: 500;
}

.switch-link a {
    text-decoration: none;
    color: #818cf8;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.switch-link a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s;
}

.switch-link a:hover::after {
    width: 100%;
}

.switch-link a:hover {
    color: var(--accent-secondary);
}

/* Welcome Section - Right Side */
.welcome-section {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 60px 80px;
    z-index: 1;
    background: linear-gradient(135deg,
            rgba(99, 102, 241, 0.05) 0%,
            rgba(79, 70, 229, 0.08) 100%);
    transition: all 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.welcome-section.signin {
    right: 0;
}

.welcome-section.signin .slide-element {
    animation: fadeInScale 1s ease-out forwards;
    animation-delay: 0.5s;
}

.welcome-section.signup {
    left: 0;
    transform: translateX(-100%);
    opacity: 0;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Toggle - Welcome Section Swap */
.auth-wrapper.toggled .welcome-section.signin {
    transform: translateX(100%);
    opacity: 0;
}

.auth-wrapper.toggled .welcome-section.signup {
    transform: translateX(0);
    opacity: 1;
}

.auth-wrapper.toggled .welcome-section.signup .slide-element {
    animation: fadeInScale 1s ease-out forwards;
    animation-delay: 0.5s;
}

.welcome-section h2 {
    font-size: 52px;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.2;
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-primary) 50%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(99, 102, 241, 0.3);
    letter-spacing: 2px;
}

/* Updated Background Shapes */
.auth-wrapper .background-shape {
    position: absolute;
    right: 0;
    top: -5px;
    height: 600px;
    width: 850px;
    background: linear-gradient(135deg,
            rgba(99, 102, 241, 0.15) 0%,
            rgba(139, 92, 246, 0.15) 100%);
    backdrop-filter: blur(60px);
    transform: rotate(10deg) skewY(40deg);
    transform-origin: bottom right;
    transition: 1.5s ease;
    transition-delay: 1.6s;
    border: 1px solid var(--border-color);
}

.auth-wrapper.toggled .background-shape {
    transform: rotate(0deg) skewY(0deg);
    transition-delay: .5s;
}

.auth-wrapper .secondary-shape {
    position: absolute;
    left: 250px;
    top: 100%;
    height: 700px;
    width: 850px;
    background: var(--bg-secondary);
    border-top: 2px solid var(--accent-primary);
    transform: rotate(0deg) skewY(0deg);
    transform-origin: bottom left;
    transition: 1.5s ease;
    transition-delay: .5s;
}

.auth-wrapper.toggled .secondary-shape {
    transform: rotate(-11deg) skewY(-41deg);
    transition-delay: 1.2s;
}

/* Error Messages */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-left: 4px solid #ef4444;
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    margin-top: 20px;
    display: none;
    text-align: left;
    animation: shakeError 0.4s;
}

.error-message.show {
    display: block;
}

@keyframes shakeError {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* Footer - Designed by Aayush */
.auth-footer {
    position: relative;
    margin-top: 18px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    z-index: 10;
    text-align: center;
    font-weight: 500;
}

.auth-footer .brand-link {
    color: var(--accent-primary);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.auth-footer .brand-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s;
}

.auth-footer .brand-link:hover::after {
    width: 100%;
}

.auth-footer .brand-link:hover {
    color: var(--accent-secondary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .auth-wrapper {
        height: auto;
        min-height: 100vh;
    }

    .auth-wrapper .credentials-panel,
    .welcome-section {
        width: 100%;
        position: relative;
    }

    .credentials-panel.signin,
    .credentials-panel.signup {
        padding: 40px 30px;
        left: 0;
        right: 0;
    }

    .credentials-panel.signin {
        display: flex;
    }

    .credentials-panel.signup {
        display: none;
    }

    .auth-wrapper.toggled .credentials-panel.signin {
        display: none;
    }

    .auth-wrapper.toggled .credentials-panel.signup {
        display: flex;
    }

    .credentials-panel.signin .slide-element,
    .credentials-panel.signup .slide-element {
        transform: translateY(0);
        opacity: 1;
        filter: blur(0);
    }

    .welcome-section {
        display: none;
    }

    .credentials-panel h2 {
        font-size: 28px;
        margin-bottom: 10px;
    }

    .auth-wrapper .background-shape,
    .auth-wrapper .secondary-shape {
        display: none;
    }

    .field-wrapper {
        margin-top: 20px;
    }
}

@media (max-width: 480px) {

    .credentials-panel.signin,
    .credentials-panel.signup {
        padding: 30px 20px;
    }

    .credentials-panel h2 {
        font-size: 24px;
    }

    .field-wrapper input,
    .field-wrapper label {
        font-size: 14px;
    }

    .submit-button,
    .google-btn {
        font-size: 14px;
        height: 40px;
    }

    .switch-link {
        font-size: 13px;
    }
}