/**
 * auth.css - Ultra Modern Authentication Page Styles
 * Pink & White Theme with Advanced Animations
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Pink Color Palette */
    --primary-pink: #EC4899;
    --primary-pink-light: #F472B6;
    --primary-pink-dark: #DB2777;
    --accent-pink: #BE185D;
    --dark-bg: #0F172A;
    --darker-bg: #020617;
    --card-bg: #1E293B;
    --surface: #334155;
    --border: #475569;
    
    /* Neutrals */
    --white: #FFFFFF;
    --off-white: #F8FAFC;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    
    /* Status Colors */
    --success: #10B981;
    --success-light: #34D399;
    --error: #EF4444;
    --error-light: #F87171;
    --warning: #F59E0B;
    
    /* Shadows & Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-pink: 0 20px 60px -15px rgba(236, 72, 153, 0.4);
    --shadow-pink-strong: 0 25px 80px -20px rgba(236, 72, 153, 0.6);
    
    /* Blur */
    --blur-sm: blur(4px);
    --blur-md: blur(12px);
    --blur-lg: blur(24px);
    --blur-xl: blur(40px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Page Layout */
.modern-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--darker-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: relative;
    overflow: hidden;
    padding: 24px;
}

/* Animated Background */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

/* Gradient Orbs */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: float 25s infinite ease-in-out;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-pink), transparent);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-pink), transparent);
    bottom: -150px;
    right: -150px;
    animation-delay: 8s;
}

.orb-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--primary-pink-light), transparent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 16s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.15;
    }
    25% {
        transform: translate(100px, -100px) scale(1.1);
        opacity: 0.2;
    }
    50% {
        transform: translate(-50px, 80px) scale(0.9);
        opacity: 0.15;
    }
    75% {
        transform: translate(80px, 50px) scale(1.05);
        opacity: 0.18;
    }
}

/* Grid Overlay */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(236, 72, 153, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(236, 72, 153, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
}

/* Floating Particles */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-pink);
    border-radius: 50%;
    opacity: 0;
    animation: particle-float 15s infinite ease-in-out;
    box-shadow: 0 0 10px var(--primary-pink);
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 25%; animation-delay: 2s; }
.particle:nth-child(3) { left: 40%; animation-delay: 4s; }
.particle:nth-child(4) { left: 55%; animation-delay: 6s; }
.particle:nth-child(5) { left: 70%; animation-delay: 8s; }
.particle:nth-child(6) { left: 85%; animation-delay: 10s; }
.particle:nth-child(7) { left: 15%; animation-delay: 12s; }
.particle:nth-child(8) { left: 60%; animation-delay: 14s; }

@keyframes particle-float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

/* Container */
.modern-auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Card */
.modern-auth-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 28px;
    padding: 44px 36px;
    box-shadow: 
        var(--shadow-2xl),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

/* Card Glow Effect */
.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.08) 0%, transparent 70%);
    animation: glow-pulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glow-pulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Header */
.modern-auth-header {
    text-align: center;
    margin-bottom: 36px;
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.logo-icon {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, var(--primary-pink), var(--primary-pink-light));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    position: relative;
    box-shadow: 
        var(--shadow-pink),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
    animation: logo-float 3s ease-in-out infinite;
}

@keyframes logo-float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(2deg);
    }
}

.logo-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--primary-pink);
    border-radius: 20px;
    opacity: 0.3;
    animation: ring-pulse 2s ease-in-out infinite;
}

.logo-ring:nth-child(1) {
    animation-delay: 0s;
}

.logo-ring:nth-child(2) {
    animation-delay: 0.3s;
}

.logo-ring:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes ring-pulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.15);
        opacity: 0;
    }
    100% {
        transform: scale(1.15);
        opacity: 0;
    }
}

.auth-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--white);
    margin: 0 0 10px 0;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--white), var(--gray-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    font-size: 15px;
    color: var(--gray-400);
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.2px;
}

/* Alerts */
.modern-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 24px;
    animation: alert-slide 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@keyframes alert-slide {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modern-alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success-light);
}

.modern-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error-light);
}

.modern-alert-error p{
color: white;
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.alert-content {
    flex: 1;
}

.alert-content p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
}

.alert-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: currentColor;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-close:hover {
    opacity: 1;
}

/* Form */
.modern-auth-form {
    margin-bottom: 28px;
}

.modern-form-group {
    margin-bottom: 22px;
    animation: form-item-fade 0.6s ease-out backwards;
}

.modern-form-group:nth-child(2) { animation-delay: 0.1s; }
.modern-form-group:nth-child(3) { animation-delay: 0.2s; }

@keyframes form-item-fade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modern-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-200);
    font-size: 14px;
    letter-spacing: 0.3px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--gray-500);
    pointer-events: none;
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    font-size: 15px;
    border: 1.5px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.5);
    color: var(--white);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.modern-input::placeholder {
    color: var(--gray-600);
}

.modern-input:focus {
    outline: none;
    border-color: var(--primary-pink);
    background: rgba(15, 23, 42, 0.7);
    box-shadow: 
        0 0 0 4px rgba(236, 72, 153, 0.1),
        0 8px 16px -4px rgba(236, 72, 153, 0.2);
    transform: translateY(-1px);
}

.modern-input:focus ~ .input-icon {
    color: var(--primary-pink);
    transform: scale(1.1);
}

.input-highlight {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-pink), var(--primary-pink-light));
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 0 14px 14px;
}



/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
    border-radius: 8px;
}

.password-toggle:hover {
    color: var(--primary-pink);
    background: rgba(236, 72, 153, 0.1);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
    animation: form-item-fade 0.6s ease-out 0.3s backwards;
}

.modern-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.modern-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 6px;
    margin-right: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(15, 23, 42, 0.5);
}

.checkmark svg {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-checkbox input:checked ~ .checkmark {
    background: linear-gradient(135deg, var(--primary-pink), var(--primary-pink-light));
    border-color: var(--primary-pink);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
}

.modern-checkbox input:checked ~ .checkmark svg {
    opacity: 1;
    transform: scale(1);
}

.checkbox-label {
    font-size: 14px;
    color: var(--gray-300);
    font-weight: 500;
}

.forgot-link {
    font-size: 14px;
    color: var(--primary-pink-light);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.forgot-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-pink-light);
    transition: width 0.3s ease;
}

.forgot-link:hover {
    color: var(--primary-pink);
}

.forgot-link:hover::after {
    width: 100%;
}

/* Button */
.modern-btn {
    width: 100%;
    padding: 15px 24px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
    animation: form-item-fade 0.6s ease-out 0.4s backwards;
}

.modern-btn-primary {
    background: linear-gradient(135deg, var(--primary-pink), var(--primary-pink-light));
    color: var(--white);
    box-shadow: 
        0 4px 16px rgba(236, 72, 153, 0.4),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
}

.modern-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.modern-btn-primary:hover::before {
    left: 100%;
}

.modern-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 24px rgba(236, 72, 153, 0.5),
        0 4px 12px rgba(236, 72, 153, 0.3),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.3);
}

.modern-btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 
        0 2px 8px rgba(236, 72, 153, 0.4),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
}

.modern-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-arrow {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-btn:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-loader {
    display: none;
    gap: 6px;
}

.btn-loader span {
    width: 8px;
    height: 8px;
    background: var(--white);
    border-radius: 50%;
    animation: loader-bounce 1.4s infinite ease-in-out both;
}

.btn-loader span:nth-child(1) { animation-delay: -0.32s; }
.btn-loader span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loader-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.modern-btn.loading .btn-content {
    opacity: 0;
}

.modern-btn.loading .btn-loader {
    display: flex;
}

/* Footer */
.modern-auth-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    animation: form-item-fade 0.6s ease-out 0.5s backwards;
}

.modern-auth-footer p {
    margin: 0;
    color: var(--gray-400);
    font-size: 14px;
}

.signup-link {
    color: var(--primary-pink-light);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.signup-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-pink-light);
    transition: width 0.3s ease;
}

.signup-link:hover {
    color: var(--primary-pink);
}

.signup-link:hover::after {
    width: 100%;
}

/* Version Tag */
.version-tag {
    text-align: center;
    margin-top: 24px;
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Error States */
.modern-input.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.05);
}

.modern-input.error:focus {
    box-shadow: 
        0 0 0 4px rgba(239, 68, 68, 0.1),
        0 8px 16px -4px rgba(239, 68, 68, 0.2);
}

.input-error-message {
    color: var(--error-light);
    font-size: 13px;
    margin-top: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: error-shake 0.5s ease;
}

@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Success States */
.modern-input.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

/* Responsive Design */
@media (max-width: 640px) {
    .modern-auth-page {
        padding: 16px;
    }

    .modern-auth-card {
        padding: 40px 28px;
        border-radius: 28px;
    }

    .auth-title {
        font-size: 30px;
    }

    .auth-subtitle {
        font-size: 14px;
    }

    .logo-icon {
        width: 70px;
        height: 70px;
        border-radius: 20px;
    }

    .logo-icon svg {
        width: 28px;
        height: 28px;
    }

    .modern-form-group {
        margin-bottom: 24px;
    }

    .modern-input {
        padding: 14px 16px 14px 48px;
        font-size: 16px;
    }

    .modern-btn {
        padding: 16px 24px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .orb-1, .orb-2, .orb-3 {
        width: 350px;
        height: 350px;
    }
}

@media (max-width: 400px) {
    .modern-auth-card {
        padding: 32px 24px;
        border-radius: 24px;
    }

    .auth-title {
        font-size: 26px;
    }

    .logo-icon {
        width: 64px;
        height: 64px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible */
.modern-btn:focus-visible,
.modern-input:focus-visible,
.password-toggle:focus-visible,
.forgot-link:focus-visible,
.signup-link:focus-visible,
.alert-close:focus-visible {
    outline: 2px solid var(--primary-pink);
    outline-offset: 3px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .modern-auth-card {
        border: 2px solid var(--primary-pink);
    }

    .modern-input {
        border-width: 2px;
    }
}