
/* Xeep Secure Signup/Login System Forms CSS */

/* ===== ANIMATIONS ===== */
@keyframes xssl-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

@keyframes xssl-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes xssl-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes xssl-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes xssl-success-pop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* Form container */
.xssl-form-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.xssl-form-container.xssl-animate-in {
    animation: xssl-fade-in 0.5s ease-out forwards;
}

/* Form title */
.xssl-form-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

/* Form group */
.xssl-form-group {
    margin-bottom: 20px;
    position: relative;
}

/* Field animation */
.xssl-animate-field {
    opacity: 0;
    animation: xssl-slide-in 0.4s ease-out forwards;
    animation-delay: var(--field-delay, 0s);
}

/* Labels */
.xssl-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    transition: color 0.2s ease;
}

/* Form help text */
.xssl-form-help {
    margin-top: 5px;
    font-size: 14px;
    color: #64748B;
    line-height: 1.4;
}

/* Inputs */
.xssl-form-group input[type="text"],
.xssl-form-group input[type="email"],
.xssl-form-group input[type="password"] {
    width: 100%;
    height: 44px;
    padding: 8px 16px;
    font-size: 16px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    background-color: #F8FAFC;
    color: #1E293B;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.xssl-form-group input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
    border-color: #4A6CF7;
    background-color: #fff;
    transform: translateY(-1px);
}

.xssl-form-group input:hover:not(:focus) {
    border-color: #94A3B8;
}

/* Input validation states */
.xssl-form-group input.xssl-input-error {
    border-color: #EF4444;
    animation: xssl-shake 0.5s ease-in-out;
}

.xssl-form-group input.xssl-input-success {
    border-color: #10B981;
}

/* Password field with toggle */
.xssl-password-field {
    position: relative;
}

.xssl-password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #64748B;
    font-size: 18px;
    padding: 4px;
    z-index: 2;
    transition: all 0.2s ease;
}

.xssl-password-toggle:hover {
    color: #1E293B;
    transform: translateY(-50%) scale(1.1);
}

.xssl-password-toggle.active {
    color: #4A6CF7;
}

/* Remember me checkbox */
.xssl-remember-me {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.xssl-remember-me input[type="checkbox"] {
    margin-right: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.xssl-remember-me input[type="checkbox"]:hover {
    transform: scale(1.1);
}

/* Terms checkbox */
.xssl-terms {
    margin-top: 20px;
    margin-bottom: 20px;
}

.xssl-terms label {
    display: flex;
    align-items: flex-start;
}

.xssl-terms input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.xssl-terms input[type="checkbox"]:hover {
    transform: scale(1.1);
}

/* Form links */
.xssl-form-links {
    margin-top: 20px;
    text-align: center;
}

.xssl-form-links a {
    color: #4A6CF7;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
}

.xssl-form-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #4A6CF7;
    transition: width 0.3s ease;
}

.xssl-form-links a:hover::after {
    width: 100%;
}

.xssl-form-links a:hover {
    color: #3254e0;
}

/* Forgot password link */
.xssl-forgot-link {
    display: inline-block;
    margin-bottom: 10px;
}

/* Back link */
.xssl-back-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 14px;
    color: #64748B !important;
}

.xssl-back-link:hover {
    color: #4A6CF7 !important;
}

/* Resend verification link */
.xssl-resend-link {
    display: inline-block;
    margin-top: 8px;
    font-weight: 500;
    text-decoration: underline !important;
}

/* ===== SUBMIT BUTTON WITH SPINNER ===== */
.xssl-submit-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background-color: #4A6CF7;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.xssl-submit-button:hover:not(:disabled) {
    background-color: #3254e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 108, 247, 0.4);
}

.xssl-submit-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(74, 108, 247, 0.3);
}

.xssl-submit-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.3);
}

/* Button text */
.xssl-button-text {
    transition: opacity 0.2s ease;
}

/* Button spinner (hidden by default) */
.xssl-button-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: xssl-spin 0.8s linear infinite;
}

/* Submit button loading state */
.xssl-submit-button.loading {
    opacity: 0.85;
    cursor: not-allowed;
    pointer-events: none;
}

.xssl-submit-button.loading .xssl-button-spinner {
    display: block;
}

/* Legacy support: loading state with ::after pseudo-element */
.xssl-submit-button.loading:not(:has(.xssl-button-spinner))::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: calc(50% - 10px);
    right: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: xssl-spin 0.8s infinite linear;
}

/* ===== MESSAGES ===== */
.xssl-message {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    animation: xssl-slide-in 0.3s ease-out;
}

.xssl-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #DC2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
    animation: xssl-shake 0.5s ease-in-out, xssl-slide-in 0.3s ease-out;
}

.xssl-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
    animation: xssl-success-pop 0.4s ease-out;
}

/* ===== PASSWORD STRENGTH METER ===== */
.xssl-password-strength {
    height: 4px;
    margin-top: 8px;
    border-radius: 2px;
    background-color: #E2E8F0;
    position: relative;
    overflow: hidden;
}

.xssl-password-strength::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

.xssl-password-strength[data-strength="weak"]::before {
    width: 33.33%;
    background-color: #EF4444;
}

.xssl-password-strength[data-strength="medium"]::before {
    width: 66.66%;
    background-color: #F59E0B;
}

.xssl-password-strength[data-strength="strong"]::before {
    width: 100%;
    background-color: #10B981;
}

.xssl-password-strength-text {
    margin-top: 5px;
    font-size: 12px;
    transition: color 0.3s ease;
}

.xssl-password-strength-text[data-strength="weak"] {
    color: #EF4444;
}

.xssl-password-strength-text[data-strength="medium"] {
    color: #F59E0B;
}

.xssl-password-strength-text[data-strength="strong"] {
    color: #10B981;
}

/* ===== VERIFICATION MESSAGE ===== */
.xssl-verification-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    animation: xssl-fade-in 0.5s ease-out;
}

.xssl-verification-icon {
    font-size: 60px;
    margin-bottom: 20px;
    color: #4A6CF7;
    animation: xssl-success-pop 0.6s ease-out;
}

.xssl-verification-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1E293B;
}

.xssl-verification-text {
    font-size: 16px;
    margin-bottom: 25px;
    color: #64748B;
}

/* ===== FOCUS RING UTILITY ===== */
.xssl-focus-ring:focus-visible {
    outline: 2px solid #4A6CF7;
    outline-offset: 2px;
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 480px) {
    .xssl-form-container {
        padding: 20px;
        margin: 0 15px;
    }
    
    .xssl-form-title {
        font-size: 20px;
    }
    
    .xssl-form-group input[type="text"],
    .xssl-form-group input[type="email"],
    .xssl-form-group input[type="password"] {
        font-size: 15px;
        height: 40px;
    }
    
    .xssl-submit-button {
        font-size: 15px;
        padding: 10px 20px;
    }
    
    /* Reduce animations on mobile for performance */
    .xssl-animate-in,
    .xssl-animate-field {
        animation-duration: 0.3s;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
