/* Custom CSS Variables and Reset */
:root {
    --bg-dark: #09090e;
    --card-bg: rgba(18, 18, 30, 0.35);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-glow: rgba(99, 102, 241, 0.15);
    
    /* Harmonious HSL colors */
    --primary: hsl(239, 84%, 67%);
    --primary-glow: hsla(239, 84%, 67%, 0.45);
    --primary-dark: hsl(239, 84%, 57%);
    --secondary: hsl(295, 82%, 60%);
    --accent: hsl(188, 86%, 53%);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-error: #ef4444;
    --text-success: #10b981;
    
    --input-bg: rgba(15, 15, 25, 0.4);
    --input-border: rgba(255, 255, 255, 0.05);
    --input-focus-border: rgba(99, 102, 241, 0.4);
    
    --transition-smooth: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

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

/* Background Grids and Blobs */
.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
    mask-image: radial-gradient(circle, black 40%, transparent 90%);
    -webkit-mask-image: radial-gradient(circle, black 40%, transparent 90%);
    pointer-events: none;
    z-index: 0;
}

.bg-blobs {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.45;
    mix-blend-mode: screen;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    animation: blob-float-1 25s infinite alternate ease-in-out;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary);
    bottom: -150px;
    right: -150px;
    animation: blob-float-2 30s infinite alternate ease-in-out;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    top: 50%;
    left: 60%;
    transform: translate(-50%, -50%);
    animation: blob-float-3 20s infinite alternate ease-in-out;
}

@keyframes blob-float-1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 50px) scale(1.1); }
}

@keyframes blob-float-2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-100px, -80px) scale(1.15); }
}

@keyframes blob-float-3 {
    0% { transform: translate(-50%, -50%) rotate(0deg) scale(0.9); }
    100% { transform: translate(-30%, -40%) rotate(360deg) scale(1.1); }
}

/* Toast Notifications styling */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
    max-width: 380px;
    width: calc(100% - 48px);
}

.toast {
    background: rgba(15, 15, 25, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: toast-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.toast-error {
    border-left: 4px solid var(--text-error);
}

.toast.toast-success {
    border-left: 4px solid var(--text-success);
}

.toast-message {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    margin-left: auto;
    font-size: 16px;
    display: flex;
    align-items: center;
}

@keyframes toast-in {
    0% { transform: translateY(-20px) scale(0.9); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Layout Wrapper */
.main-wrapper {
    width: 100%;
    max-width: 1200px;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10;
}

/* Glassmorphism Card Container */
.card-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-radius: 24px;
    width: 480px;
    padding: 40px 0 0 0;
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.3),
        0 0 40px 10px var(--card-glow);
    overflow: hidden;
    transition: var(--transition-smooth);
    position: relative;
}

/* Logo Styling */
.card-header {
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    padding: 0 40px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent));
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 24px;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #fff 30%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Sliding Tab Controller */
.tabs-control {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 4px;
    display: flex;
    width: 100%;
    position: relative;
    z-index: 1;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    padding: 10px 0;
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s ease;
    outline: none;
}

.tab-btn.active {
    color: var(--text-main);
}

.tab-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    z-index: 1;
    transition: var(--transition-smooth);
}

/* CSS trigger rule to move tab slider when active classes are present */
.card-container.signup-active .tab-slider {
    left: calc(50%);
}

/* Forms layout and Sliding effect */
.forms-wrapper {
    display: flex;
    width: 200%;
    transition: var(--transition-smooth);
}

.card-container.signup-active .forms-wrapper {
    transform: translateX(-50%);
}

.auth-form {
    width: 50%;
    padding: 0 40px 40px 40px;
    transition: opacity 0.3s ease;
    opacity: 0.3;
}

.auth-form.active {
    opacity: 1;
}

.card-container.signup-active #login-form {
    opacity: 0.3;
    pointer-events: none;
}

.card-container.signup-active #signup-form {
    opacity: 1;
}

.form-header {
    margin-bottom: 28px;
}

.form-header h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.form-header p {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
}

/* Inputs design */
.input-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.input-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color 0.3s ease;
}

.input-icon svg {
    width: 18px;
    height: 18px;
}

.input-field-wrapper input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 14px 16px 14px 48px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: var(--transition-smooth);
}

.input-field-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.input-field-wrapper input:focus {
    border-color: var(--input-focus-border);
    background: rgba(15, 15, 25, 0.6);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

.input-field-wrapper input:focus + .password-toggle,
.input-field-wrapper input:focus ~ .input-icon {
    color: var(--primary);
}

/* Password Toggle Eye styling */
.password-toggle {
    position: absolute;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
    transition: color 0.3s ease;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.password-toggle:hover {
    color: var(--text-main);
}

.hidden {
    display: none !important;
}

/* Premium Button design */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
    padding: 14px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: 0.5s ease;
}

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

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

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

/* Button Loading Spinner */
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Outline button version for dashboard */
.outline-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.outline-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: none;
}

/* Dashboard Success Card State */
.dashboard-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 40px 40px 40px;
}

.success-icon-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--text-success);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.2));
}

.success-icon-wrapper svg {
    width: 32px;
    height: 32px;
}

.welcome-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.welcome-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 32px;
}

.user-info-box {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.info-label {
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    color: var(--text-main);
    font-weight: 600;
}

.text-green {
    color: var(--text-success) !important;
}

/* Animations helpers */
.animate-pulse {
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.3); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Responsive styles */
@media (max-width: 520px) {
    .card-container {
        width: 100%;
        padding: 30px 0 0 0;
        border-radius: 20px;
    }
    
    .card-header {
        padding: 0 24px;
    }
    
    .auth-form {
        padding: 0 24px 30px 24px;
    }
    
    .dashboard-content {
        padding: 10px 24px 30px 24px;
    }
    
    .main-wrapper {
        padding: 16px;
    }
    
    .form-header h2 {
        font-size: 22px;
    }
    
    .welcome-title {
        font-size: 24px;
    }
}
