/* Custom variables & Design System (Matching main page) */
:root {
    --bg-dark: #050505;
    --bg-card: #0c0c0e;
    --bg-card-hover: #121215;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --text-muted: #55575c;
    --accent-blue: #3b82f6;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Background Glow Orbs */
.glow-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.12;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-blue);
    top: 10%;
    left: -10%;
    animation: pulse 8s infinite alternate ease-in-out;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: #60a5fa;
    bottom: 5%;
    right: -10%;
    animation: pulse 12s infinite alternate-reverse ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.15) translate(20px, -20px); }
}

/* Back to Home Button */
.back-home-btn {
    position: absolute;
    top: 40px;
    left: 40px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
}

.back-home-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: translateX(-4px);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Login/Signup Container */
.container {
    background-color: rgba(12, 12, 14, 0.65);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
    width: 768px;
    max-width: 100%;
    min-height: 540px;
    z-index: 10;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* General spacing inside forms */
.container p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 1.2rem 0;
}

.container h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.divider-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: block;
}

/* Input Fields styling */
.input-wrapper {
    position: relative;
    width: 100%;
    margin: 8px 0;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.3s ease;
}

.container input {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 12px 16px 12px 46px;
    border-radius: 12px;
    width: 100%;
    outline: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.container input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.container input:focus {
    background-color: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.04);
}

.container input:focus + .input-icon {
    color: var(--text-primary);
}

/* Forms layout */
.container form {
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 50px;
    height: 100%;
    text-align: center;
}

.form-logo {
    height: 24px;
    width: auto;
    object-fit: contain;
    margin-bottom: 1.5rem;
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

.forgot-pass {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    margin: 15px 0 10px;
    transition: color 0.2s;
}

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

/* Buttons style */
.btn-submit {
    font-family: var(--font-body);
    background-color: var(--text-primary);
    color: var(--bg-dark);
    font-size: 0.85rem;
    padding: 12px 45px;
    border: 1px solid var(--text-primary);
    border-radius: 100px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
}

.btn-submit:hover {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.12);
}

.btn-toggle {
    font-family: var(--font-body);
    background-color: transparent;
    color: var(--text-primary);
    font-size: 0.85rem;
    padding: 12px 45px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 100px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-toggle:hover {
    background-color: var(--text-primary);
    color: var(--bg-dark);
    border-color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

/* Form Container transitions and layering */
.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.6s cubic-bezier(0.86, 0, 0.07, 1);
}

.sign-in {
    left: 0;
    width: 50%;
    z-index: 2;
}

.container.active .sign-in {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

.sign-up {
    left: 0;
    width: 50%;
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

.container.active .sign-up {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    pointer-events: all;
}

/* Social icons layout */
.social-icons {
    margin: 1.2rem 0;
    display: flex;
    gap: 0.5rem;
}

.social-icons a {
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icons a:hover {
    border-color: var(--border-hover);
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* Sliding Toggle Slider container */
.toggle-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.86, 0, 0.07, 1);
    z-index: 1000;
    border-left: 1px solid var(--border-color);
}

.container.active .toggle-container {
    transform: translateX(-100%);
    border-left: none;
    border-right: 1px solid var(--border-color);
}

/* Toggle Slider element */
.toggle {
    height: 100%;
    background: linear-gradient(135deg, #101012 0%, #060607 100%);
    color: var(--text-primary);
    position: relative;
    left: -100%;
    width: 200%;
    transform: translateX(0);
    transition: all 0.6s cubic-bezier(0.86, 0, 0.07, 1);
}

.container.active .toggle {
    transform: translateX(50%);
}

.toggle-panel {
    position: absolute;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    top: 0;
    transform: translateX(0);
    transition: all 0.6s cubic-bezier(0.86, 0, 0.07, 1);
}

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

.container.active .toggle-left {
    transform: translateX(0);
}

.toggle-right {
    right: 0;
    transform: translateX(0);
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 1.5rem;
    }
    
    .back-home-btn {
        top: 20px;
        left: 20px;
    }
    
    .container {
        min-height: 580px;
        border-radius: 20px;
        width: 100%;
    }
    
    /* On mobile, collapse sliding split screen into simple layouts */
    .container.active .sign-up {
        transform: none;
        width: 100%;
    }
    
    .sign-in {
        width: 100%;
    }
    
    .container.active .sign-in {
        transform: none;
    }
    
    .sign-up {
        width: 100%;
    }
    
    .toggle-container {
        display: none; /* Hide decorative toggle sidebar on small screens */
    }
}

/* Spinner Animation Styles */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-submit.loading {
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border-color: var(--border-hover) !important;
    pointer-events: none;
    cursor: default;
}

.btn-submit.loading .spinner {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: var(--text-primary);
}