/**
 * BizSync Authentication Styles
 * Modern dark glassmorphism theme for login/auth pages
 */

/* ========================================
   Reset
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --auth-bg-primary: #0a0a0f;
    --auth-bg-secondary: #12121a;
    --auth-bg-card: rgba(255, 255, 255, 0.03);
    --auth-border-color: rgba(255, 255, 255, 0.08);
    --auth-text-primary: #ffffff;
    --auth-text-secondary: #8b8b9e;
    --auth-text-muted: #5a5a6e;
    --auth-accent-teal: #14b8a6;
    --auth-accent-teal-light: #2dd4bf;
    --auth-accent-amber: #f59e0b;
    --auth-danger: #ef4444;
    --auth-input-bg: rgba(255, 255, 255, 0.04);
}

/* ========================================
   Base Styles
   ======================================== */
.auth-page {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--auth-bg-primary);
    color: var(--auth-text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   Animated Background
   ======================================== */
.auth-bg-animation {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.auth-bg-animation::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(20, 184, 166, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(20, 184, 166, 0.08) 0%, transparent 40%);
    animation: authBgFloat 20s ease-in-out infinite;
}

@keyframes authBgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, 2%) rotate(1deg); }
    66% { transform: translate(-1%, 1%) rotate(-1deg); }
}

/* Grid Pattern */
.auth-grid-pattern {
    position: fixed;
    inset: 0;
    z-index: 1;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

/* Floating Orbs */
.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: authOrbFloat 15s ease-in-out infinite;
}

.auth-orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.4), rgba(20, 184, 166, 0.1));
    top: 10%;
    right: 15%;
    animation-delay: 0s;
}

.auth-orb-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.05));
    bottom: 20%;
    left: 10%;
    animation-delay: -5s;
}

.auth-orb-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.3), transparent);
    top: 60%;
    right: 30%;
    animation-delay: -10s;
}

@keyframes authOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -30px) scale(1.05); }
    50% { transform: translate(-10px, 20px) scale(0.95); }
    75% { transform: translate(15px, 10px) scale(1.02); }
}

/* ========================================
   Main Container
   ======================================== */
.auth-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* ========================================
   Auth Card
   ======================================== */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--auth-bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--auth-border-color);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: authCardAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ========================================
   Logo
   ======================================== */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 2.5rem;
}

.auth-logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--auth-accent-teal), var(--auth-accent-teal-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(20, 184, 166, 0.3);
}

.auth-logo-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.auth-logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--auth-text-primary), var(--auth-text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* ========================================
   Header
   ======================================== */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--auth-text-primary);
    margin-bottom: 0.5rem;
}

.auth-header p {
    font-size: 0.9rem;
    color: var(--auth-text-secondary);
}

/* ========================================
   Status Message
   ======================================== */
.auth-status-message {
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.2);
    color: var(--auth-accent-teal-light);
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* ========================================
   Form Elements
   ======================================== */
.auth-form-group {
    margin-bottom: 1.5rem;
}

.auth-form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--auth-text-secondary);
    margin-bottom: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-input-wrapper {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-text-muted);
    pointer-events: none;
    transition: color 0.2s;
}

.auth-input-wrapper:focus-within .auth-input-icon {
    color: var(--auth-accent-teal);
}

.auth-form-input {
    width: 100%;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-border-color);
    border-radius: 12px;
    padding: 0.9rem 1rem 0.9rem 2.75rem;
    font-size: 0.95rem;
    color: var(--auth-text-primary);
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

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

.auth-form-input:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

.auth-form-input:focus {
    border-color: var(--auth-accent-teal);
    background: rgba(20, 184, 166, 0.05);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.auth-form-input.error {
    border-color: var(--auth-danger);
}

.auth-form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Password with right padding for toggle */
.auth-form-input-password {
    padding-right: 3rem;
}

/* ========================================
   Password Toggle
   ======================================== */
.auth-password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--auth-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

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

/* ========================================
   Error Message
   ======================================== */
.auth-error-message {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--auth-danger);
}

/* ========================================
   Form Options (Remember & Forgot)
   ======================================== */
.auth-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.auth-remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.auth-remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-accent-teal);
    cursor: pointer;
}

.auth-remember-me span {
    font-size: 0.875rem;
    color: var(--auth-text-secondary);
}

.auth-forgot-link {
    font-size: 0.875rem;
    color: var(--auth-accent-teal);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-forgot-link:hover {
    color: var(--auth-accent-teal-light);
}

/* ========================================
   Submit Button
   ======================================== */
.auth-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--auth-accent-teal), #0d9488);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(20, 184, 166, 0.3);
    position: relative;
    overflow: hidden;
}

.auth-submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(20, 184, 166, 0.4);
}

.auth-submit-btn:hover::before {
    transform: translateX(100%);
}

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

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

.auth-submit-btn:hover svg {
    transform: translateX(3px);
}

/* ========================================
   Status Success Message
   ======================================== */
.auth-status-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.auth-status-success svg {
    flex-shrink: 0;
}

/* ========================================
   Form Footer (Back Link)
   ======================================== */
.auth-form-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--auth-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-back-link:hover {
    color: var(--auth-accent-teal);
}

.auth-back-link svg {
    transition: transform 0.2s;
}

.auth-back-link:hover svg {
    transform: translateX(-3px);
}

/* ========================================
   Footer
   ======================================== */
.auth-footer {
    margin-top: 2rem;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--auth-border-color);
}

.auth-footer p {
    font-size: 0.8rem;
    color: var(--auth-text-muted);
}

/* ========================================
   Version Badge
   ======================================== */
.auth-version-badge {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--auth-text-muted);
    background: var(--auth-bg-card);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--auth-border-color);
    z-index: 20;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 480px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    
    .auth-logo-text {
        font-size: 1.5rem;
    }
    
    .auth-form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}
