/* Loading spinner animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

body {
    background-color: #f8fafc !important;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        sans-serif !important;
    position: relative !important;
    overflow: hidden;
    min-height: 100vh !important;
    background: linear-gradient(
        160deg,
        #635bff 0%,
        #7b6eff 35%,
        #f8fafc 35%,
        #f8fafc 100%
    ) !important;
}

/* Particles container */
#particles-js {
    position: absolute;
    width: 100%;
    height: 48%;
    top: -264px;
    left: -30px;
    z-index: 1;
    pointer-events: none;
    background-color: transparent;
    rotate: 350deg;
}

/* Animated background with gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(170deg, #635bff 0%, #7b6eff 35%, #f8fafc 35%, #f8fafc 100%);
    z-index: -3;
}

/* Shimmer effect */
.shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    z-index: -2;
    animation: shimmerAnimation 6s ease-in-out infinite;
}

/* Additional patterns */
.patterns {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(123, 110, 255, 0.4) 0%, transparent 60%),
        radial-gradient(circle at 80% 70%, rgba(99, 91, 255, 0.5) 0%, transparent 60%);
    z-index: -2;
    opacity: 0.7;
    animation: patternAnimation 15s ease-in-out infinite alternate;
}

/* Light beam */
.light-beam {
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0) 70%
    );
    pointer-events: none;
    z-index: -1;
    opacity: 0.8;
    transform: translate(-50%, -50%);
    animation: beamAnimation 15s ease-in-out infinite;
}

.fi-input-wrp {
    padding: 0 !important;
}

.fi-simple-login {
    max-width: 400px;
    margin: 10rem auto;
    margin-top: 100px;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    box-shadow:
        0 10px 25px rgba(99, 91, 255, 0.15),
        0 2px 5px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    position: relative;
    z-index: 10; /* Higher z-index to ensure it's above particles */
    transition:
        box-shadow 0.3s ease,
        transform 0.3s ease;
    border: 1px solid rgba(99, 91, 255, 0.1);
    overflow: hidden; /* Ensure particles don't overflow */
}

/* Ensure all login form elements are above particles */
.fi-simple-login * {
    position: relative;
    z-index: 11;
}

.fi-simple-login:hover {
    box-shadow:
        0 15px 30px rgba(99, 91, 255, 0.3),
        0 3px 8px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.4) inset;
    transform: translateY(-2px);
}

.fi-simple-login .fi-btn,
.fi-simple-login .fi-btn-submit,
.fi-simple-login button[type='submit'] {
    background-color: #635bff !important;
    width: 100% !important;
    justify-content: center !important;
    font-weight: 600 !important;
    margin-top: 1rem !important;
    border: none !important;
    color: white !important;
    padding: 0.75rem !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    position: relative;
    overflow: hidden;
    transition:
        background-color 0.3s ease,
        transform 0.2s ease;
}

.fi-simple-login .fi-btn:hover,
.fi-simple-login .fi-btn-submit:hover,
.fi-simple-login button[type='submit']:hover {
    background-color: #5a52e0 !important;
    transform: translateY(-1px);
}

.fi-simple-login .fi-btn:active,
.fi-simple-login .fi-btn-submit:active,
.fi-simple-login button[type='submit']:active {
    transform: translateY(1px);
}

.fi-simple-login .fi-btn,
.fi-simple-login .fi-btn-submit,
.fi-simple-login button[type='submit'] {
    display: inline-grid !important;
    grid-auto-flow: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.375rem !important; /* Match Filament's gap-1.5 */
    width: 100% !important;
    min-height: 2.5rem !important;
}

.fi-simple-login .fi-btn .fi-loading-indicator,
.fi-simple-login .fi-btn-submit .fi-loading-indicator,
.fi-simple-login button[type='submit'] .fi-loading-indicator {
    width: 1rem !important;
    height: 1rem !important;
    animation: spin 1s linear infinite !important;
    transition: opacity 0.2s ease-in-out;
}

.space-y-8 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-y-reverse: 0 !important;
    margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse))) !important;
    margin-bottom: calc(1rem * var(--tw-space-y-reverse)) !important;
}

.fi-simple-login .space-y-8 {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    margin: 0 !important;
}

.fi-form-component,
.filament-forms-field-wrapper {
    margin-bottom: 1rem !important;
}

.fi-input-wrp,
.fi-fo-field-wrp {
    margin-bottom: 1rem !important;
}

.fi-field-wrp,
.fi-fo-field-wrp {
    margin-bottom: 1rem !important;
}

.fi-form,
.fi-form-component-ctn {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
}

.fi-btn,
.fi-btn-submit,
.filament-button,
button[type='submit'],
.fi-fo-btn,
.fi-simple-login button[type='submit'],
.filament-button-submit,
.fi-btn-primary {
    background-color: #635bff !important;
    width: 100% !important;
    justify-content: center !important;
    font-weight: 600 !important;
    margin-top: 1rem !important;
    border: none !important;
    color: white !important;
    padding: 0.75rem !important;
    border-radius: 0.375rem !important;
    cursor: pointer !important;
}

.fi-btn:hover,
.fi-btn-submit:hover,
.filament-button:hover,
button[type='submit']:hover,
.fi-fo-btn:hover,
.filament-button-submit:hover,
.fi-btn-primary:hover {
    background-color: #5a52e0 !important;
}

.fi-input,
.fi-input-wrp input,
.filament-forms-input-component input,
.fi-fo-text-input,
input[type='email'],
input[type='password'],
.fi-simple-login input,
.fi-fo-text-input,
.fi-fo-password-input {
    border: 1px solid #e5e7eb !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.9375rem !important;
    width: 100% !important;
    border-radius: 0.375rem !important;
    background-color: white !important;
    box-sizing: border-box !important;
}

.fi-input:focus,
.fi-input-wrp input:focus,
.filament-forms-input-component input:focus,
.fi-fo-text-input:focus,
input[type='email']:focus,
input[type='password']:focus,
.fi-simple-login input:focus,
.fi-fo-text-input:focus,
.fi-fo-password-input:focus {
    border-color: #635bff !important;
    box-shadow: 0 0 0 1px #635bff !important;
    outline: none !important;
}

.fi-checkbox,
.fi-checkbox-input,
.filament-forms-checkbox-component input,
input[type='checkbox'] {
    border-color: #e5e7eb !important;
    width: 1rem !important;
    height: 1rem !important;
}

.fi-checkbox:checked,
.fi-checkbox-input:checked,
.filament-forms-checkbox-component input:checked,
input[type='checkbox']:checked {
    background-color: #635bff !important;
    border-color: #635bff !important;
}

.fi-form-actions,
.filament-form-actions {
    flex-direction: column !important;
    align-items: stretch !important;
}

.filament-forms-field-wrapper,
.fi-fo-field {
    margin-bottom: 1rem !important;
}

.filament-forms-field-wrapper-label,
.fi-fo-field-wrp-label,
label {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #374151 !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
}

.grid.gap-y-4,
.fi-fo-component-ctn {
    display: grid !important;
    gap: 1rem !important;
}

form[wire\:submit\.prevent='authenticate'] {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
}

.fi-simple-login form {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
}

.fi-simple-login * {
    box-sizing: border-box !important;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 3rem;
    margin-top: 3rem;
}

.fi-input-wrp {
    padding: 0 !important;
}

.fi-input-wrp-suffix {
    display: none !important;
}

.login-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
