/* Auth Pages Custom Styles */

/* Background Gradient */
.bg-gradient-to-br.from-gray-900.via-gray-800.to-gray-900 {
    background: linear-gradient(135deg, #111827 0%, #1f2937 50%, #111827 100%);
    min-height: 100vh;
}

/* Glassmorphism Cards */
.bg-white\/5.backdrop-blur-sm {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Form Inputs */
.bg-gray-800\/50.border.border-gray-700 {
    background: rgba(31, 41, 55, 0.5);
    border-color: rgba(55, 65, 81, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bg-gray-800\/50.border.border-gray-700:focus {
    border-color: #22d3ee;
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2);
    background: rgba(31, 41, 55, 0.7);
}

/* Button Styles */
.bg-gradient-to-r.from-cyan-500.to-emerald-500 {
    background: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bg-gradient-to-r.from-cyan-500.to-emerald-500:hover {
    background: linear-gradient(135deg, #0891b2 0%, #059669 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.3);
}

.bg-gradient-to-r.from-cyan-500.to-emerald-500:active {
    transform: translateY(0);
}

/* Button Loading State */
button.loading {
    pointer-events: none;
    opacity: 0.8;
}

button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Input Error States */
input.error {
    border-color: #ef4444 !important;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-2px); }
    40%, 60% { transform: translateX(2px); }
}

/* Success Animation */
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid #10b981;
}

.check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotate-circle 4.25s ease-in;
}

.icon-line {
    height: 5px;
    background-color: #10b981;
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.icon-line.line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s;
}

.icon-line.line-long {
    top: 38px;
    right: 8px;
    width: 47px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s;
}

@keyframes rotate-circle {
    0% { transform: rotate(-45deg); }
    5% { transform: rotate(-45deg); }
    12% { transform: rotate(-405deg); }
    100% { transform: rotate(-405deg); }
}

@keyframes icon-line-tip {
    0% { width: 0; left: 1px; top: 19px; }
    54% { width: 0; left: 1px; top: 19px; }
    70% { width: 50px; left: -8px; top: 37px; }
    84% { width: 17px; left: 21px; top: 48px; }
    100% { width: 25px; left: 14px; top: 45px; }
}

@keyframes icon-line-long {
    0% { width: 0; right: 46px; top: 54px; }
    65% { width: 0; right: 46px; top: 54px; }
    84% { width: 55px; right: 0px; top: 35px; }
    100% { width: 47px; right: 8px; top: 38px; }
}

/* Modal Animations */
#forgotPasswordModal {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#forgotPasswordModal.active {
    opacity: 1;
    visibility: visible;
}

#forgotPasswordModal .bg-gray-900 {
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
}

#forgotPasswordModal.active .bg-gray-900 {
    transform: translateY(0);
    opacity: 1;
}

/* Password Strength Meter */
.password-strength-bar {
    transition: width 0.3s ease;
}

.password-strength-weak {
    background-color: #ef4444;
}

.password-strength-medium {
    background-color: #f59e0b;
}

.password-strength-strong {
    background-color: #10b981;
}

/* Focus Rings */
*:focus-visible {
    outline: 2px solid #22d3ee;
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Stack columns */
    .grid.md\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    /* Larger touch targets */
    input, button, a[role="button"] {
        min-height: 44px;
    }
    
    /* Adjust padding */
    .p-8 {
        padding: 1.5rem;
    }
    
    .p-6 {
        padding: 1.25rem;
    }
    
    /* Smaller text on mobile */
    .text-3xl {
        font-size: 1.875rem;
    }
    
    .text-4xl {
        font-size: 2.25rem;
    }
    
    /* Adjust form spacing */
    .space-y-6 > * + * {
        margin-top: 1rem;
    }
    
    /* Modal full screen on mobile */
    #forgotPasswordModal {
        padding: 1rem;
    }
    
    #forgotPasswordModal .bg-gray-900 {
        width: 100%;
        max-width: 100%;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    button.loading::after {
        animation: none;
        display: none;
    }
    
    input.error {
        animation: none;
    }
}

/* Print Styles */
@media print {
    main.bg-gradient-to-br.from-gray-900.via-gray-800.to-gray-900 {
        background: white !important;
    }
    
    .bg-white\/5.backdrop-blur-sm,
    .bg-gradient-to-br.from-amber-900\/30.to-orange-900\/30,
    .bg-gradient-to-br.from-cyan-900\/30.to-emerald-900\/30 {
        background: #f9fafb !important;
        border: 1px solid #e5e7eb !important;
        box-shadow: none !important;
    }
    
    button,
    a,
    .password-toggle,
    .close-modal {
        display: none !important;
    }
    
    /* Ensure good contrast */
    .text-white {
        color: #111827 !important;
    }
    
    .text-gray-300,
    .text-gray-400 {
        color: #6b7280 !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bg-gray-800\/50.border.border-gray-700 {
        background: #1f2937 !important;
        border: 2px solid #4b5563 !important;
    }
    
    .bg-gradient-to-r.from-cyan-500.to-emerald-500 {
        background: #0d9488 !important;
        border: 2px solid #000;
    }
    
    *:focus-visible {
        outline: 3px solid #000;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(34, 211, 238, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 211, 238, 0.5);
}

/* Password Toggle Animation */
.password-toggle svg {
    transition: transform 0.2s ease;
}

.password-toggle.active svg {
    transform: scale(1.1);
}

/* Input Label Animation */
.form-group label {
    transition: all 0.2s ease;
}

.form-group input:focus + label {
    color: #22d3ee;
}

/* Error Message Animation */
.text-sm.text-gray-400[class*="Error"] {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button Hover Lift Effect */
.hover\:scale-\[1\.02\]:hover {
    transform: translateY(-1px) scale(1.02);
}

/* Trust Badge Pulse Animation */
.w-2.h-2.bg-emerald-500.rounded-full.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Form Group Spacing */
.form-group {
    position: relative;
}

.form-group + .form-group {
    margin-top: 1.5rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Success Message Animation */
.bg-emerald-500\/10 {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}