/* ========== AUTH PAGES - MODERN DESIGN ========== */

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

/* Animated background shapes */
.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    top: -200px;
    right: -200px;
    animation: float 20s ease-in-out infinite;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    bottom: -100px;
    left: -100px;
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(30px, -30px) rotate(5deg);
    }
    50% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }
    75% {
        transform: translate(10px, 10px) rotate(3deg);
    }
}

/* Additional floating elements */
.auth-bg-shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.auth-bg-shape-1 {
    width: 200px;
    height: 200px;
    top: 20%;
    left: 10%;
    animation: floatSlow 30s ease-in-out infinite;
}

.auth-bg-shape-2 {
    width: 150px;
    height: 150px;
    bottom: 30%;
    right: 15%;
    animation: floatSlow 25s ease-in-out infinite reverse;
}

.auth-bg-shape-3 {
    width: 100px;
    height: 100px;
    top: 60%;
    left: 5%;
    animation: floatSlow 35s ease-in-out infinite;
}

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-40px) translateX(20px);
        opacity: 0.8;
    }
}

/* Auth card */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
    animation: authCardSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes authCardSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Card header with logo */
.auth-card-header {
    padding: 40px 40px 0 40px;
    text-align: center;
}

.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.auth-logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
    }
}

.auth-logo-icon img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.auth-logo-icon i {
    font-size: 40px;
    color: #ffffff;
}

.auth-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.5px;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
    letter-spacing: -0.3px;
}

.auth-subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Card body */
.auth-card-body {
    padding: 32px 40px 40px 40px;
}

/* Session status */
.auth-session-status {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.4s ease-out;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.auth-session-status::before {
    content: '✓';
    font-size: 16px;
}

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

/* Form styling */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-form-label i {
    font-size: 18px;
    color: #6366f1;
}

.auth-form-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    color: #1f2937;
    background: #f9fafb;
    transition: all 0.3s ease;
    outline: none;
}

.auth-form-input:hover {
    border-color: #c7d2fe;
    background: #ffffff;
}

.auth-form-input:focus {
    border-color: #6366f1;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.auth-form-input::placeholder {
    color: #9ca3af;
}

/* Password input with toggle */
.auth-password-wrapper {
    position: relative;
}

.auth-password-wrapper .auth-form-input {
    padding-right: 50px;
}

.auth-password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.auth-password-toggle:hover {
    color: #6366f1;
}

.auth-password-toggle i {
    font-size: 20px;
}

/* Forgot password link */
.auth-forgot-link {
    display: block;
    text-align: right;
    font-size: 0.875rem;
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    margin-top: -4px;
}

.auth-forgot-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* Remember me checkbox */
.auth-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.2s ease;
    position: relative;
    background: #f9fafb;
}

.auth-checkbox:hover {
    border-color: #c7d2fe;
}

.auth-checkbox:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #6366f1;
}

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

.auth-checkbox-label {
    font-size: 0.9rem;
    color: #6b7280;
    cursor: pointer;
}

/* Submit button */
.auth-submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-top: 8px;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

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

.auth-submit-btn .btn-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-submit-btn .btn-text i.material-icons {
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    width: 22px;
}

.auth-submit-btn .btn-text span {
    line-height: 1;
    display: flex;
    align-items: center;
}

/* Spinning animation for loading icon */
.auth-submit-btn .spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Hidden utility class */
.auth-submit-btn .hidden {
    display: none !important;
}

/* Hide Livewire navigate loading bar and overlays */
[wire\:navigate] [wire\:loading],
.nprogress,
#nprogress,
[x-data] [x-show],
body > div[style*="position: fixed"][style*="z-index"],
body > div[style*="position:fixed"][style*="z-index"],
.auth-wrapper > div[style*="position: fixed"],
.auth-wrapper > div[style*="position:fixed"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Loading state */
.auth-submit-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.auth-submit-btn.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error messages */
.auth-error {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: shake 0.4s ease-out;
}

.auth-error::before {
    content: '!';
    width: 16px;
    height: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: #ef4444;
}

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

/* Card footer */
.auth-card-footer {
    padding: 20px 40px 32px 40px;
    text-align: center;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}

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

.auth-footer-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-footer-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.auth-divider-line {
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.auth-divider-text {
    font-size: 0.85rem;
    color: #9ca3af;
    font-weight: 500;
}

/* Social login buttons */
.auth-social-buttons {
    display: flex;
    gap: 12px;
}

.auth-social-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-social-btn:hover {
    border-color: #c7d2fe;
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-social-btn i {
    font-size: 20px;
}

/* Responsive design */
@media (max-width: 480px) {
    .auth-wrapper {
        padding: 16px;
    }
    
    .auth-card {
        border-radius: 20px;
    }
    
    .auth-card-header {
        padding: 32px 24px 0 24px;
    }
    
    .auth-card-body {
        padding: 24px 24px 32px 24px;
    }
    
    .auth-card-footer {
        padding: 16px 24px 24px 24px;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .auth-logo-icon {
        width: 70px;
        height: 70px;
        border-radius: 16px;
    }
    
    .auth-logo-icon i {
        font-size: 35px;
    }
    
    .auth-social-buttons {
        flex-direction: column;
    }
}

/* Dark mode support */
.auth-wrapper.dark-mode {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
}

.auth-wrapper.dark-mode .auth-card {
    background: #1f2937;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.auth-wrapper.dark-mode .auth-logo-text,
.auth-wrapper.dark-mode .auth-title {
    color: #f9fafb;
}

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

.auth-wrapper.dark-mode .auth-form-label {
    color: #e5e7eb;
}

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

.auth-wrapper.dark-mode .auth-form-input:hover {
    border-color: #6366f1;
    background: #4b5563;
}

.auth-wrapper.dark-mode .auth-form-input:focus {
    border-color: #818cf8;
    background: #4b5563;
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.2);
}

.auth-wrapper.dark-mode .auth-form-input::placeholder {
    color: #6b7280;
}

.auth-wrapper.dark-mode .auth-checkbox {
    background: #374151;
    border-color: #4b5563;
}

.auth-wrapper.dark-mode .auth-checkbox-label {
    color: #d1d5db;
}

.auth-wrapper.dark-mode .auth-card-footer {
    background: #111827;
    border-top-color: #374151;
}

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

.auth-wrapper.dark-mode .auth-social-btn {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

.auth-wrapper.dark-mode .auth-social-btn:hover {
    border-color: #6366f1;
    background: #4b5563;
}

/* Wire loading state for Livewire */
[wire\:loading].auth-submit-btn {
    pointer-events: none;
    opacity: 0.8;
}

[wire\:loading].auth-submit-btn .btn-text {
    display: none;
}

[wire\:loading].auth-submit-btn::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Additional animations */
.auth-form-group {
    animation: fadeInUp 0.4s ease-out backwards;
}

.auth-form-group:nth-child(1) {
    animation-delay: 0.1s;
}

.auth-form-group:nth-child(2) {
    animation-delay: 0.15s;
}

.auth-form-group:nth-child(3) {
    animation-delay: 0.2s;
}

.auth-form-group:nth-child(4) {
    animation-delay: 0.25s;
}

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

/* Validation states */
.auth-form-input.is-invalid {
    border-color: #ef4444;
    background: #fef2f2;
}

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

.auth-form-input.is-valid {
    border-color: #10b981;
    background: #f0fdf4;
}

.auth-form-input.is-valid:focus {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}
