/**
 * Authentication Modals Styles
 * 
 * @package Grabit
 * @version 1.0
 */

/* Modal Overlay & Base */
.gi-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.gi-modal.hidden {
    display: none;
}

.gi-modal-overlay {
    transition: opacity 0.3s ease-in-out;
}

.gi-modal-panel {
    animation: modalSlideIn 0.3s ease-out;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close Button */
.gi-modal .gi-close {
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.2s ease;
}

.gi-modal .gi-close:hover {
    transform: scale(1.1);
}

.gi-modal .gi-close:focus {
    outline: 2px solid #5caf90;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Form Inputs */
.gi-auth-form .gi-input {
    transition: all 0.2s ease;
}

.gi-auth-form .gi-input:hover {
    border-color: #d1d5db;
}

.gi-auth-form .gi-input:focus {
    outline: none;
    border-color: #5caf90;
    box-shadow: 0 0 0 3px rgba(92, 175, 144, 0.1);
}

.gi-auth-form .gi-input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.gi-auth-form .gi-input:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

/* Submit Button */
.gi-auth-form .gi-btn {
    position: relative;
    overflow: hidden;
}

.gi-auth-form .gi-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.gi-auth-form .gi-btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(92, 175, 144, 0.3);
}

.gi-auth-form .gi-btn:not(:disabled):active {
    transform: translateY(0);
}

.gi-auth-form .gi-btn:focus-visible {
    outline: 2px solid #5caf90;
    outline-offset: 2px;
}

/* Feedback Messages */
.gi-auth-feedback {
    animation: feedbackSlideIn 0.3s ease-out;
}

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

/* Loading Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Password Strength Indicator */
#password-strength {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Checkbox & Radio Custom Styles */
.gi-auth-form input[type="checkbox"]:focus {
    outline: 2px solid #5caf90;
    outline-offset: 2px;
}

/* Links */
.gi-auth-form a:focus-visible {
    outline: 2px solid #5caf90;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Honeypot field (visually hidden) */
input[name="cc_hp"] {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .gi-modal-panel {
        margin: 1rem;
        padding: 1.25rem;
        max-width: calc(100vw - 2rem);
    }
    
    .gi-modal .gi-close {
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .gi-auth-form h2 {
        font-size: 1.125rem;
        margin-bottom: 1.25rem;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    .gi-modal-panel {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .gi-auth-form .gi-input {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .gi-auth-form .gi-input::placeholder {
        color: #9ca3af;
    }
    
    .gi-auth-form label {
        color: #e5e7eb;
    }
}

/* Accessibility: High Contrast Mode */
@media (prefers-contrast: high) {
    .gi-modal-overlay {
        background-color: rgba(0, 0, 0, 0.9);
    }
    
    .gi-auth-form .gi-input:focus {
        outline: 3px solid currentColor;
        outline-offset: 2px;
    }
}

/* Print Styles */
@media print {
    .gi-modal {
        display: none !important;
    }
}

/* Focus visible polyfill support */
.js-focus-visible .gi-auth-form *:focus:not(.focus-visible) {
    outline: none;
}

