/* Modern Authentication Styles */

/* CSS Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --error-color: #e53e3e;
    --success-color: #38a169;
    --shadow-light: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --shadow-medium: 0 15px 35px rgba(31, 38, 135, 0.2);
    --shadow-heavy: 0 25px 50px rgba(31, 38, 135, 0.3);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.auth-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
}

/* Floating Shapes */
.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 120px;
    height: 120px;
    top: 20%;
    right: 10%;
    animation-delay: 1s;
}

.shape-3 {
    width: 60px;
    height: 60px;
    bottom: 30%;
    left: 20%;
    animation-delay: 2s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    bottom: 20%;
    right: 20%;
    animation-delay: 3s;
}

.shape-5 {
    width: 40px;
    height: 40px;
    top: 50%;
    left: 50%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
        opacity: 0.7;
    }
    50% { 
        transform: translateY(-20px) rotate(180deg); 
        opacity: 1;
    }
}

/* Main Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* Auth Card */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-medium);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

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

/* Logo Section */
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-link {
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2rem;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.logo-text {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo-accent {
    background: linear-gradient(135deg, #ffeaa7, #fab1a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Content Area */
.auth-content {
    position: relative;
}

/* Form Styles */
.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    font-size: 1rem;
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Error Styles */
.form-error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-input.error {
    border-color: var(--error-color);
    background: rgba(229, 62, 62, 0.05);
}

/* Button Styles */
.btn-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Checkbox Styles */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.custom-checkbox {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
}

.custom-checkbox input {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.checkbox-mark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: var(--transition);
}

.custom-checkbox input:checked + .checkbox-mark {
    background: var(--primary-gradient);
    border-color: transparent;
}

.checkbox-mark::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked + .checkbox-mark::after {
    display: block;
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* Links */
.auth-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.auth-link:hover {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.auth-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: var(--transition);
}

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

/* Utility Classes */
.text-center { text-align: center; }
.text-white { color: white; }
.text-muted { color: var(--text-muted); }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }

/* Tab Navigation */
.auth-tabs {
    margin-bottom: 2rem;
}

.tab-buttons {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 4px;
    backdrop-filter: blur(8px);
}

.tab-button {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-button:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Password Requirements */
.password-requirements {
    margin-top: 0.5rem;
}

.password-requirements p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Forgot Password Icon */
.forgot-password-icon,
.reset-password-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin: 0 auto;
    backdrop-filter: blur(8px);
    transition: var(--transition);
}

.forgot-password-icon:hover,
.reset-password-icon:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.15);
}

/* Success/Info Messages */
.success-message {
    background: rgba(56, 161, 105, 0.1);
    border: 1px solid rgba(56, 161, 105, 0.3);
    color: #68d391;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
}

.info-message {
    background: rgba(66, 153, 225, 0.1);
    border: 1px solid rgba(66, 153, 225, 0.3);
    color: #90cdf4;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
}

/* Help Section */
.help-section {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    backdrop-filter: blur(8px);
}

.help-section h3 {
    color: white;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-section p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.help-section p:last-child {
    margin-bottom: 0;
}

/* Enhanced Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translate3d(0,0,0); }
    40%, 43% { transform: translate3d(0, -8px, 0); }
    70% { transform: translate3d(0, -4px, 0); }
    90% { transform: translate3d(0, -2px, 0); }
}

.bounce {
    animation: bounce 1s infinite;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Keyboard Navigation Support */
.keyboard-navigation *:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Floating Label Effects */
.form-group.is-focused .form-label,
.form-group.has-value .form-label {
    transform: translateY(-8px) scale(0.85);
    color: rgba(255, 255, 255, 0.9);
}

.form-group .form-label {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left top;
}

/* Responsive Design */
@media (max-width: 480px) {
    .auth-container {
        padding: 1rem 0.5rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        margin: 0 0.5rem;
    }

    .logo-text {
        font-size: 1.75rem;
    }

    .logo-icon {
        font-size: 1.75rem;
    }

    .tab-button {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }

    .forgot-password-icon {
        width: 60px;
        height: 60px;
    }

    .forgot-password-icon i {
        font-size: 2rem;
    }
}

@media (max-width: 320px) {
    .auth-card {
        padding: 1.5rem 1rem;
    }

    .form-input {
        padding: 0.75rem;
        font-size: 0.875rem;
    }

    .btn-primary {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .tab-buttons {
        flex-direction: column;
        gap: 4px;
    }

    .tab-button {
        padding: 0.75rem;
    }
}
