/* CSS Variables */
:root {
    /* Modern Color Palette */
    --primary-gradient-start: #4776E6;
    --primary-gradient-end: #8E54E9;
    --secondary-gradient-start: #00B4DB;
    --secondary-gradient-end: #0083B0;
    
    /* Base Colors */
    --primary-color: #4776E6;
    --primary-dark: #3461c1;
    --primary-light: #6b93ff;
    --secondary-color: #00B4DB;
    --accent-color: #8E54E9;
    --success-color: #00C853;
    --warning-color: #FFB300;
    --error-color: #FF5252;
    --info-color: #00B8D4;

    /* Text Colors */
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.87);
    --text-tertiary: rgba(255, 255, 255, 0.6);
    
    /* Background Colors */
    --background-main: #0A1929;
    --background-paper: rgba(255, 255, 255, 0.05);
    --background-elevated: rgba(255, 255, 255, 0.08);
    
    /* Component Colors */
    --card-background: rgba(255, 255, 255, 0.08);
    --card-border: rgba(255, 255, 255, 0.12);
    --input-background: rgba(255, 255, 255, 0.06);
    --input-border: rgba(255, 255, 255, 0.15);
    --input-focus-border: rgba(255, 255, 255, 0.35);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.25);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

/* Global Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    background: var(--background-main);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Animation */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        var(--background-start),
        var(--primary-color),
        var(--secondary-color),
        var(--accent-color)
    );
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    z-index: -2;
}

/* Floating Shapes */
.floating-shapes {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    animation: float 20s infinite;
}

.shape.circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
}

.shape.triangle {
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 86px solid rgba(255, 255, 255, 0.05);
    background: none;
}

.shape.square {
    width: 80px;
    height: 80px;
    transform: rotate(45deg);
}

/* Auth Container */
.auth-container {
    width: 100%;
    max-width: 460px;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

/* Auth Box */
.auth-box {
    background: var(--card-background);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--card-border);
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    position: relative;
}

.auth-tab.active {
    color: var(--text-primary);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

/* Form Groups */
.form-group {
    margin-bottom: 1.75rem;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.625rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding-left: 0.25rem;
}

/* Input Styling */
.input-icon-wrapper {
    position: relative;
    display: grid;
    grid-template-columns: 46px 1fr;
    align-items: center;
    gap: 0.75rem;
    background: var(--input-background);
    border: 1px solid var(--input-border);
    border-radius: 0.75rem;
    padding: 0.625rem 0.75rem;
    margin: 0.25rem 0;
}

.input-icon-wrapper .icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
    font-size: 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
}

.input-icon-wrapper input,
.input-icon-wrapper select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    min-width: 0; /* Prevents input from overflowing */
}

.input-icon-wrapper:focus-within {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(28, 181, 224, 0.2);
}

.input-icon-wrapper input:focus,
.input-icon-wrapper select:focus {
    outline: none;
}

.input-icon-wrapper input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Button Styling */
.auth-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    border: none;
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Form Footer */
.form-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.forgot-password {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-color);
}

/* Back Button */
.back-button {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 10;
}

.back-link {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    background: var(--card-background);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 2rem;
}

.back-link:hover {
    color: var(--text-primary);
    background: var(--input-background);
}

.back-arrow {
    margin-right: 0.5rem;
}

/* Animations */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Responsive Design */
@media (max-width: 480px) {
    .auth-container {
        padding: 1rem;
    }

    .auth-box {
        padding: 1.5rem;
    }

    .back-button {
        top: 1rem;
        left: 1rem;
    }

    .auth-button {
        padding: 0.8rem;
    }
}

/* Loading States */
.auth-button.loading {
    position: relative;
    color: transparent;
}

.auth-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--text-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: button-loading 0.8s linear infinite;
}

@keyframes button-loading {
    to { transform: rotate(360deg); }
}
 
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.password-hint,
.password-match-status,
.identifier-hint {
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

.password-match-status.match {
    color: #28a745;
}

.password-match-status.no-match {
    color: #dc3545;
}

.password-hint,
.identifier-hint {
    color: #666;
}

.auth-button {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-button:hover {
    background-color: #0056b3;
}

.auth-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

.auth-success {
    color: #28a745;
    font-size: 14px;
    margin-top: 5px;
}

.form-footer {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: #666;
}

.form-footer a {
    color: #007bff;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* User Profile Styles */
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    cursor: pointer;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #007bff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: bold;
    margin: 0;
}

.user-email {
    font-size: 12px;
    color: #666;
    margin: 0;
}