/* Login New - Custom CSS for Tailwind-based login flow */

/* Custom animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes successPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

@keyframes buttonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.97); }
    100% { transform: scale(1); }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-success-pulse {
    animation: successPulse 2s ease-in-out infinite;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-button-press {
    animation: buttonPress 0.15s ease-out;
}

.animate-bounce-in {
    animation: bounceIn 0.5s ease-out;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Loading button spinner */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Notification */
.notification {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 50;
    font-weight: 500;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #10b981;
    color: white;
}

.notification.error {
    background: #ef4444;
    color: white;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
    font-weight: 500;
}

.toast-notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.toast-notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.toast-notification.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.toast-notification.hiding {
    animation: slideOutRight 0.3s ease-out forwards;
}

/* Button with ripple effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* Button click animation */
.btn-click-effect:active {
    transform: scale(0.97);
}

/* Icon circle expand animation */
.icon-circle {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.4);
}

.icon-circle.loading {
    animation: successPulse 1.5s ease-in-out infinite;
}

.icon-circle.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    animation: bounceIn 0.5s ease-out;
}

.icon-circle.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    animation: shake 0.5s ease-in-out;
}

/* Card hover effect */
.card-interactive {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
}

/* Input field animations */
.input-animated {
    transition: all 0.2s ease;
}

.input-animated:focus {
    transform: translateY(-1px);
}

/* Social button effects */
.social-btn-animated {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-btn-animated:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.2);
}

.social-btn-animated:active {
    transform: translateY(-2px);
}

/* Password strength bars */
.strength-bar {
    height: 4px;
    flex: 1;
    border-radius: 9999px;
    transition: background-color 0.2s;
}

.strength-bar.weak { background-color: #ef4444; }
.strength-bar.fair { background-color: #f59e0b; }
.strength-bar.good { background-color: #3b82f6; }
.strength-bar.strong { background-color: #10b981; }

/* Code input focus styling */
.code-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Custom scrollbar for dark mode */
.dark ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Form validation styling */
.field-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.input-error {
    border-color: #ef4444 !important;
}

.input-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* Auth method card hover effects */
.auth-method-card {
    transition: all 0.2s ease;
}

.auth-method-card:hover {
    transform: translateY(-2px);
}

/* Social button hover effects */
.social-btn {
    transition: all 0.2s ease;
}

.social-btn:hover {
    transform: translateY(-2px);
}

/* Timer countdown styling */
.timer-text {
    font-variant-numeric: tabular-nums;
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 1rem;
}

.dark .loading-overlay {
    background: rgba(31, 41, 55, 0.8);
}

/* Password input eye toggle */
.password-toggle-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.25rem;
    color: #9ca3af;
    transition: color 0.2s;
}

.password-toggle-btn:hover {
    color: #6b7280;
}

.dark .password-toggle-btn:hover {
    color: #d1d5db;
}

/* Smooth transitions for theme change */
* {
    transition-property: background-color, border-color, color;
    transition-duration: 200ms;
    transition-timing-function: ease;
}

/* Disable transition on page load */
.no-transitions * {
    transition: none !important;
}

/* Avatar placeholder */
.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-transform: uppercase;
}

/* Passkey animation */
.passkey-icon-container {
    transition: all 0.3s ease;
}

.passkey-icon-container.authenticating {
    animation: successPulse 1.5s ease-in-out infinite;
}

.passkey-icon-container.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.passkey-icon-container.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Card shadow enhancement */
.login-card {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Input focus ring improvements */
.focus-ring {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Host login form fields. Keep these explicit because the login Razor page uses
   utility classes that may not be present in the generated stylesheet. */
.login-email-input,
.login-password-input {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    caret-color: #0369a1;
    border-radius: 0.75rem;
}

.login-email-input::placeholder,
.login-password-input::placeholder {
    color: #64748b !important;
    opacity: 1;
}

.login-email-input:focus,
.login-password-input:focus {
    background-color: #ffffff !important;
    border-color: #0ea5e9 !important;
    color: #0f172a !important;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.16) !important;
}

.dark .login-email-input,
.dark .login-password-input {
    background-color: #162338 !important;
    border-color: #7dd3fc !important;
    color: #f8fafc !important;
    caret-color: #38bdf8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(125, 211, 252, 0.18) !important;
}

.dark .login-email-input::placeholder,
.dark .login-password-input::placeholder {
    color: #cbd5e1 !important;
}

.dark .login-email-input:focus,
.dark .login-password-input:focus {
    background-color: #1d2d44 !important;
    border-color: #bae6fd !important;
    color: #f8fafc !important;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.dark .login-password-input + .password-toggle-btn {
    color: #e0f2fe;
}

.dark .login-password-input + .password-toggle-btn:hover {
    color: #ffffff;
}

.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.dark .focus-ring:focus {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* Additional Keyframe Animations */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Entry animations for page elements */
.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Staggered animation delays for list items */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* Card entrance animation */
.card-entrance {
    animation: fadeInUp 0.5s ease-out;
}

/* Link hover underline animation */
.link-animated {
    position: relative;
}

.link-animated::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    transition: width 0.3s ease;
}

.link-animated:hover::after {
    width: 100%;
}
