/* Auth Pages Styles (Login & Register) */

/* Auth container */
.auth-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="auth-pattern" width="40" height="40" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="60" cy="60" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23auth-pattern)"/></svg>');
    opacity: 0.4;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInUp 0.6s ease-out;
}

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

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

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

.auth-logo {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: #6b7280;
    font-size: 1rem;
}

.auth-back-link {
    display: inline-block;
    margin-top: 1rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.auth-back-link:hover {
    color: #3b82f6;
    transform: translateX(-2px);
}

/* Alert messages */
.auth-alert {
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    animation: slideInDown 0.4s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-alert.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #10b981;
}

.auth-alert.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #ef4444;
}

.auth-alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* Auth form */
.auth-form {
    space-y: 1.5rem;
}

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

.form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    position: relative;
}

.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-input:valid {
    border-color: #10b981;
}

.form-input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.form-hint {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.form-hint.error {
    color: #ef4444;
}

.form-hint.success {
    color: #10b981;
}

/* Password strength indicator */
.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: width 0.3s ease;
}

.password-strength-weak { background: #ef4444; width: 33%; }
.password-strength-medium { background: #f59e0b; width: 66%; }
.password-strength-strong { background: #10b981; width: 100%; }

.password-strength-text {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

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

.checkbox-input {
    width: 18px;
    height: 18px;
    border-radius: 0.25rem;
    border: 2px solid #d1d5db;
    background: white;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    position: relative;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.checkbox-input:checked {
    background: #3b82f6;
    border-color: #3b82f6;
}

.checkbox-input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.checkbox-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.checkbox-label {
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.4;
    cursor: pointer;
}

/* Auth button */
.auth-btn {
    width: 100%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.auth-btn::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;
}

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

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

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

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

/* Auth footer */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.auth-footer-text {
    color: #6b7280;
    font-size: 0.9rem;
}

.auth-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Loading state */
.auth-loading {
    position: relative;
}

.auth-loading .auth-btn {
    pointer-events: none;
}

.auth-spinner {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-card {
    animation: fadeIn 0.8s ease-out;
}

/* Error shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.form-group.error .form-input {
    animation: shake 0.5s ease-in-out;
}

/* Success checkmark animation */
@keyframes checkmark {
    0% {
        transform: scale(0) rotate(45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(45deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(45deg);
        opacity: 1;
    }
}

.success-checkmark {
    animation: checkmark 0.6s ease-out 0.2s both;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .auth-container {
        padding: 1rem;
    }

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

    .auth-logo {
        font-size: 2rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .auth-card {
        background: rgba(31, 41, 55, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
        color: #f9fafb;
    }

    .auth-title {
        color: #f9fafb;
    }

    .auth-subtitle {
        color: #9ca3af;
    }

    .auth-back-link {
        color: #9ca3af;
    }

    .auth-back-link:hover {
        color: #60a5fa;
    }

    .form-label {
        color: #f9fafb;
    }

    .form-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }

    .form-input:focus {
        border-color: #60a5fa;
    }

    .form-hint {
        color: #9ca3af;
    }

    .checkbox-label {
        color: #f9fafb;
    }

    .auth-footer-text {
        color: #9ca3af;
    }

    .auth-footer {
        border-color: #4b5563;
    }
}

/* Focus visible for accessibility */
.form-input:focus-visible,
.checkbox-input:focus-visible,
.auth-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
