/* ========================================
   ENHANCED FORMS STYLING
   Beautiful, Modern Form Components
   ======================================== */

/* Form Group Container */
.form-group {
    position: relative;
    margin-bottom: 24px;
}

/* Form Input Fields */
.form-input {
    width: 100%;
    padding: 16px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    background: rgba(26, 31, 53, 0.5);
    color: #e0e0e0;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

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

/* Floating Label */
.form-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s ease;
    background: transparent;
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
    top: -10px;
    left: 12px;
    font-size: 0.75rem;
    background: linear-gradient(to bottom, transparent 50%, rgba(26, 31, 53, 0.95) 50%);
    padding: 0 8px;
    color: #6366f1;
}

/* Validation States */
.form-input.error {
    border-color: #ef4444;
}

.form-input.success {
    border-color: #10b981;
}

/* Error Message */
.error-message {
    display: none;
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 6px;
    animation: slideDown 0.3s ease;
}

.form-input.error ~ .error-message {
    display: block;
}

/* Success Icon */
.success-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #10b981;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-input.success ~ .success-icon {
    opacity: 1;
    animation: checkmark 0.5s ease;
}

/* Password Toggle Button */
.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
    z-index: 10;
}

.password-toggle:hover {
    color: #a5b4fc;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 2px;
}

.strength-weak {
    width: 33%;
    background: #ef4444;
}

.strength-medium {
    width: 66%;
    background: #f59e0b;
}

.strength-strong {
    width: 100%;
    background: #10b981;
}

.strength-text {
    font-size: 0.75rem;
    margin-top: 4px;
    color: #9ca3af;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

/* Form Buttons */
.form-btn {
    padding: 14px 28px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.form-btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.form-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.form-btn-secondary {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.form-btn-secondary:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.2);
}

.form-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.form-btn.loading {
    pointer-events: none;
}

.form-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Checkbox Styling */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 20px;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    accent-color: #6366f1;
    cursor: pointer;
    flex-shrink: 0;
}

.form-checkbox label {
    font-size: 0.9rem;
    color: #c1c1c1;
    cursor: pointer;
    line-height: 1.4;
    margin: 0;
}

/* Select Dropdown */
.form-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    background: rgba(26, 31, 53, 0.5);
    color: #e0e0e0;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-select:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

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

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

@keyframes checkmark {
    0% {
        transform: translateY(-50%) scale(0);
    }
    50% {
        transform: translateY(-50%) scale(1.2);
    }
    100% {
        transform: translateY(-50%) scale(1);
    }
}
